expCore
in package
This is the class expCore
Tags
Table of Contents
- abs2rel() : string
- exdoc This function converts an absolute path, such as the one provided by the expTemplate::resolveFilePaths() function into a relative one.
- array2csv() : string
- This converts the data array into a nice CSV.
- array_diff_assoc_recursive() : mixed
- buildNameList() : mixed
- cast() : mixed
- Casts one object type to another object type
- deprecated() : mixed
- Warn admin of obsolete methods
- getCurrency() : string
- Return the amount properly formatted with the currency symbol
- getCurrencySymbol() : string
- Return the appropriate currency symbol
- glob2keyedArray() : mixed
- is_php() : bool
- Determines if the current version of PHP is equal to or greater than the supplied value
- loadData() : mixed
- Use cUrl to get data from url
- makeLink() : string
- exdoc Return a full URL, given the desired querystring arguments as an associative array.
- makeLocation() : object
- Return an exponent location object with corrected module name
- makePodcastLink() : string
- Return an old style podcast link COMPATIBILITY - we now use the {rss_link} smarty function to build rss & podcast links
- makeRSSLink() : string
- Return an old style rss link COMPATIBILITY - we now use the {rss_link} smarty function to build rss links
- makeSecureLink() : string
- exdoc Return a full URL, given the desired querystring arguments as an associative array.
- makeSefUrl() : mixed|string
- make an sef_name for specific model
- maxUploadSize() : string
- exdoc Generates and returns a string stating the current maximum accepted size of uploaded files. It intelligently parses the php.ini configuration, so that settings of 2K and 2048 are treated identically.
- maxUploadSizeMessage() : string
- exdoc Generates and returns a message stating the current maximum accepted size of uploaded files.
- resolveFilePaths() : mixed
- save_csv() : mixed
- saveData() : mixed
- Use cUrl to save data from url to file (download)
- setup_autoload() : mixed
- URLisValid() : bool
- exdoc This function checks a full URL against a set of known protocols (like http and https) and determines if the URL is valid. Returns true if the URL is valid, and false if otherwise.
Methods
abs2rel()
exdoc This function converts an absolute path, such as the one provided by the expTemplate::resolveFilePaths() function into a relative one.
public
static abs2rel(string $inPath) : string
This is useful if the file is not to be included server- but loaded client-side
Parameters
- $inPath : string
-
The absolute file path
Tags
Return values
string —array2csv()
This converts the data array into a nice CSV.
public
static array2csv( $items[, array<string|int, mixed>|null $rptcols = array() ]) : string
We grab the items array which is stored funkily in the DB in an associative array when we pull it. So basically our aray looks like this:
ITEMS {[id]=>myID, [Name]=>name, [Address]=>myaddr} {[id]=>myID1, [Name]=>name1, [Address]=>myaddr1} {[id]=>myID2, [Name]=>name2, [Address]=>myaddr2} {[id]=>myID3, [Name]=>name3, [Address]=>myaddr3} {[id]=>myID4, [Name]=>name4, [Address]=>myaddr4} {[id]=>myID5, [Name]=>name5, [Address]=>myaddr5}
So by nature of the array, the keys are repeated in each line (id, name, etc) So if we want to make a header row, we just run through once at the beginning and use the array_keys function to strip out a functional header
Parameters
Return values
string —array_diff_assoc_recursive()
public
static array_diff_assoc_recursive(mixed $array1, mixed $array2) : mixed
Parameters
- $array1 : mixed
- $array2 : mixed
Return values
mixed —buildNameList()
public
static buildNameList(mixed $type, mixed $name, mixed $subtype, mixed $subname) : mixed
Parameters
- $type : mixed
- $name : mixed
- $subtype : mixed
- $subname : mixed
Return values
mixed —cast()
Casts one object type to another object type
public
static cast( $source, $destinationtype) : mixed
Parameters
Tags
Return values
mixed —deprecated()
Warn admin of obsolete methods
public
static deprecated([string $newcall = "expTheme::module()" ][, array<string|int, mixed> $params = array() ]) : mixed
Parameters
- $newcall : string = "expTheme::module()"
- $params : array<string|int, mixed> = array()
Return values
mixed —getCurrency()
Return the amount properly formatted with the currency symbol
public
static getCurrency( $amount[, $currency_type = ECOM_CURRENCY ]) : string
Parameters
Tags
Return values
string —getCurrencySymbol()
Return the appropriate currency symbol
public
static getCurrencySymbol([ $currency_type = ECOM_CURRENCY ]) : string
Parameters
Tags
Return values
string —glob2keyedArray()
public
static glob2keyedArray(mixed $workArray) : mixed
Parameters
- $workArray : mixed
Return values
mixed —is_php()
Determines if the current version of PHP is equal to or greater than the supplied value
public
static is_php(mixed $version) : bool
Parameters
- $version : mixed
Return values
bool —TRUE if the current version is $version or higher
loadData()
Use cUrl to get data from url
public
static loadData( $url[, bool $ref = false ][, mixed $post = false ][, mixed $auth = false ]) : mixed
Parameters
Tags
Return values
mixed —makeLink()
exdoc Return a full URL, given the desired querystring arguments as an associative array.
public
static makeLink(array<string|int, mixed> $params[, string $type = '' ][, string $sef_name = '' ]) : string
This function does take into account the SEF URLs settings and the SSL urls in the site config.
Parameters
- $params : array<string|int, mixed>
-
An associative array of the desired querystring parameters.
- $type : string = ''
- $sef_name : string = ''
Tags
Return values
string —makeLocation()
Return an exponent location object with corrected module name
public
static makeLocation([null $mod = null ][, null $src = null ][, null $int = null ]) : object
Parameters
- $mod : null = null
- $src : null = null
- $int : null = null
Tags
Return values
object —makePodcastLink()
Return an old style podcast link COMPATIBILITY - we now use the {rss_link} smarty function to build rss & podcast links
public
static makePodcastLink( $params) : string
Parameters
Tags
Return values
string —makeRSSLink()
Return an old style rss link COMPATIBILITY - we now use the {rss_link} smarty function to build rss links
public
static makeRSSLink( $params) : string
Parameters
Tags
Return values
string —makeSecureLink()
exdoc Return a full URL, given the desired querystring arguments as an associative array.
public
static makeSecureLink(array<string|int, mixed> $params) : string
This function does take into account the SEF URLs settings and the SSL urls in the site config, and uses the SSL url is the site is configured to use SSL. Otherwise, it works exactly like self::makeLink.
Parameters
- $params : array<string|int, mixed>
-
An associative array of the desired querystring parameters.
Tags
Return values
string —makeSefUrl()
make an sef_name for specific model
public
static makeSefUrl(string $title, string $model) : mixed|string
Parameters
- $title : string
- $model : string
Return values
mixed|string —maxUploadSize()
exdoc Generates and returns a string stating the current maximum accepted size of uploaded files. It intelligently parses the php.ini configuration, so that settings of 2K and 2048 are treated identically.
public
static maxUploadSize() : string
Tags
Return values
string —maxUploadSizeMessage()
exdoc Generates and returns a message stating the current maximum accepted size of uploaded files.
public
static maxUploadSizeMessage() : string
Tags
Return values
string —resolveFilePaths()
public
static resolveFilePaths(mixed $type, mixed $name, mixed $subtype, mixed $subname) : mixed
Parameters
- $type : mixed
- $name : mixed
- $subtype : mixed
- $subname : mixed
Return values
mixed —save_csv()
public
static save_csv(mixed $data[, mixed $rpt_columns = array() ][, mixed $filename = 'report.csv' ]) : mixed
Parameters
- $data : mixed
- $rpt_columns : mixed = array()
- $filename : mixed = 'report.csv'
Return values
mixed —saveData()
Use cUrl to save data from url to file (download)
public
static saveData( $url, $filename[, bool $ref = false ][, bool $post = false ]) : mixed
Parameters
Tags
Return values
mixed —setup_autoload()
public
static setup_autoload(mixed $framework) : mixed
Parameters
- $framework : mixed
Return values
mixed —URLisValid()
exdoc This function checks a full URL against a set of known protocols (like http and https) and determines if the URL is valid. Returns true if the URL is valid, and false if otherwise.
public
static URLisValid(string $url) : bool
Parameters
- $url : string
-
The URL to test for validity