Public Member Functions | |
stripGpcMagicQuotes () | |
strMan ($sVal, $sKey=null) | |
strRem ($sVal, $sKey=null) | |
getArrFldName ($sName) | |
assignValuesFromText ($sIn, $dVat=null) | |
assignValuesToText ($aIn) | |
formatCurrency ($dValue, $oActCur=null) | |
currency2Float ($sValue) | |
isSearchEngine ($sClient=null) | |
isValidEmail ($sEmail) | |
rebuildCache () | |
loadAdminProfile ($aInterfaceProfiles) | |
fRound ($sVal, $oCur=null) | |
toStaticCache ($sName, $sContent, $sKey=null) | |
fromStaticCache ($sName) | |
cleanStaticCache ($sCacheName=null) | |
toPhpFileCache ($sKey, $mContents) | |
fromPhpFileCache ($sKey) | |
toFileCache ($sKey, $mContents) | |
fromFileCache ($sKey) | |
commitFileCache () | |
oxResetFileCache () | |
getRemoteCachePath ($sRemote, $sLocal) | |
checkAccessRights () | |
seoIsActive ($blReset=false, $sShopId=null, $iActLang=null) | |
getShopBit ($iShopId) | |
bitwiseAnd ($iVal1, $iVal2) | |
bitwiseOr ($iVal1, $iVal2) | |
isValidAlpha ($sField) | |
redirect ($sUrl, $blAddRedirectParam=true, $iHeaderCode=301) | |
showMessageAndExit ($sMsg) | |
setHeader ($sHeader) | |
oxMimeContentType ($sFileName) | |
logger ($sText, $blNewline=false) | |
strRot13 ($sStr) | |
prepareUrlForNoSession ($sUrl) | |
getCacheFilePath ($sCacheName, $blPathOnly=false, $sExtension= 'txt') | |
getLangCache ($sCacheName) | |
setLangCache ($sCacheName, $aLangCache) | |
checkUrlEndingSlash ($sUrl) | |
writeToLog ($sLogMessage, $sLogFileName) | |
handlePageNotFoundError ($sUrl= '') | |
extractDomain ($sHost) | |
Static Public Member Functions | |
static | getInstance () |
Protected Member Functions | |
_simpleRedirect ($sUrl, $sHeaderCode) | |
_addUrlParameters ($sUrl, $aParams) | |
_fillExplodeArray ($aName, $dVat=null) | |
_stripQuotes ($mInput) | |
_getCacheFilePath ($sCacheName, $blPathOnly=false) | |
Protected Attributes | |
$_iCurPrecision = null | |
$_sEmailTpl = "/^([-!#\$%&'*+.\/0-9=?A-Z^_`a-z{|}~\177])+@([-!#\$%&'*+\/0-9=?A-Z^_`a-z{|}~\177]+\\.)+[a-zA-Z]{2,6}\$/i" | |
$_sPermanentCachePattern = "/c_fieldnames_/" | |
$_aFileCacheContents = array() | |
$_aFileCacheWritable = array() | |
$_blIsSe = null | |
$_aStaticCache | |
$_blSeoIsActive = null | |
Static Private Attributes | |
static | $_instance = null |
Includes Smarty engine class. general utils class, used as a singelton
Definition at line 12 of file oxutils.php.
oxUtils._addUrlParameters | ( | $ | sUrl, | |
$ | aParams | |||
) | [protected] |
adds the given paramters at the end of the given url
string | $sUrl a url | |
array | $aParams the params which will be added |
Definition at line 987 of file oxutils.php.
oxUtils._fillExplodeArray | ( | $ | aName, | |
$ | dVat = null | |||
) | [protected] |
Fill array.
array | $aName Initial array of strings | |
double | $dVat Article VAT |
Definition at line 1009 of file oxutils.php.
oxUtils._getCacheFilePath | ( | $ | sCacheName, | |
$ | blPathOnly = false | |||
) | [protected] |
Returns full path (including file name) to cache file
string | $sCacheName cache file name | |
bool | $blPathOnly if TRUE, name parameter will be ignored and only cache folder will be returned (default FALSE) |
Definition at line 1172 of file oxutils.php.
oxUtils._simpleRedirect | ( | $ | sUrl, | |
$ | sHeaderCode | |||
) | [protected] |
redirects browser to given url, nothing else done just header send may be used for redirection in case of an exception or similar things
string | $sUrl code to add to the header(e.g. "HTTP/1.1 301 Moved Permanently", or "HTTP/1.1 500 Internal Server Error" | |
string | $sHeaderCode the URL to redirect to |
Definition at line 892 of file oxutils.php.
oxUtils._stripQuotes | ( | $ | mInput | ) | [protected] |
Recursively removes slashes from arrays
mixed | $mInput the input from which the slashes should be removed |
Definition at line 1122 of file oxutils.php.
oxUtils.assignValuesFromText | ( | $ | sIn, | |
$ | dVat = null | |||
) |
Takes a string and assign all values, returns array with values.
string | $sIn Initial string | |
double | $dVat Article VAT (optional) |
Definition at line 182 of file oxutils.php.
oxUtils.assignValuesToText | ( | $ | aIn | ) |
Takes an array and builds again a string. Returns string with values.
array | $aIn Initial array of strings |
Definition at line 204 of file oxutils.php.
oxUtils.bitwiseAnd | ( | $ | iVal1, | |
$ | iVal2 | |||
) |
Binary AND implementation. We use mySQL to calculate that, as currently php int size is only 32 bit.
int | $iVal1 value nr 1 | |
int | $iVal2 value nr 2 |
Definition at line 844 of file oxutils.php.
oxUtils.bitwiseOr | ( | $ | iVal1, | |
$ | iVal2 | |||
) |
Binary OR implementation. We use mySQL to calculate that, as currently php integer size is only 32 bit.
int | $iVal1 value nr 1 | |
int | $iVal2 value nr 2 |
Definition at line 862 of file oxutils.php.
oxUtils.checkAccessRights | ( | ) |
This function checks if logged in user has access to admin or not
Definition at line 711 of file oxutils.php.
oxUtils.checkUrlEndingSlash | ( | $ | sUrl | ) |
Cheks if url has ending slash / - if not, adds it
string | $sUrl url string |
Definition at line 1241 of file oxutils.php.
oxUtils.cleanStaticCache | ( | $ | sCacheName = null |
) |
Cleans all or specific data from static cache
string | $sCacheName Cache name |
Definition at line 465 of file oxutils.php.
oxUtils.commitFileCache | ( | ) |
Writes all cache contents to file at once. This method was introduced due to possible race conditions
Definition at line 613 of file oxutils.php.
oxUtils.currency2Float | ( | $ | sValue | ) |
Returns formatted currency string, according to formatting standards.
string | $sValue Formatted price |
Definition at line 244 of file oxutils.php.
oxUtils.extractDomain | ( | $ | sHost | ) |
Extracts domain name from given host
string | $sHost host name |
Definition at line 1302 of file oxutils.php.
oxUtils.formatCurrency | ( | $ | dValue, | |
$ | oActCur = null | |||
) |
Returns formatted currency string, according to formatting standards.
double | $dValue Plain price | |
object | $oActCur Object of active currency |
Definition at line 227 of file oxutils.php.
oxUtils.fromFileCache | ( | $ | sKey | ) |
Fetches contents from file cache.
string | $sKey Cache key |
Definition at line 586 of file oxutils.php.
oxUtils.fromPhpFileCache | ( | $ | sKey | ) |
Includes cached php file and loads stored contents.
string | $sKey Cache key. |
Definition at line 528 of file oxutils.php.
oxUtils.fromStaticCache | ( | $ | sName | ) |
Retrieves something from static cache
string | $sName name under which the content is stored in the satic cache |
Definition at line 450 of file oxutils.php.
oxUtils.fRound | ( | $ | sVal, | |
$ | oCur = null | |||
) |
Rounds the value to currency cents
string | $sVal the value that should be rounded | |
object | $oCur Currenncy Object |
Definition at line 389 of file oxutils.php.
oxUtils.getArrFldName | ( | $ | sName | ) |
Returns string witch "." symbols were replaced with "__".
string | $sName String to search replaceble char |
Definition at line 169 of file oxutils.php.
oxUtils.getCacheFilePath | ( | $ | sCacheName, | |
$ | blPathOnly = false , |
|||
$ | sExtension = 'txt' | |||
) |
Returns full path (including file name) to cache file
string | $sCacheName cache file name | |
bool | $blPathOnly if TRUE, name parameter will be ignored and only cache folder will be returned (default FALSE) | |
string | $sExtension cache file extension |
Definition at line 1186 of file oxutils.php.
static oxUtils.getInstance | ( | ) | [static] |
oxUtils.getLangCache | ( | $ | sCacheName | ) |
Tries to load lang cache array from cache file
string | $sCacheName cache file name |
Definition at line 1209 of file oxutils.php.
oxUtils.getRemoteCachePath | ( | $ | sRemote, | |
$ | sLocal | |||
) |
If $sLocal file is older than 24h or doesn't exist, trys to download it from $sRemote and save it as $sLocal
string | $sRemote the file | |
string | $sLocal the adress of the remote source |
Definition at line 660 of file oxutils.php.
oxUtils.getShopBit | ( | $ | iShopId | ) |
Returns integer number with bit set according to $iShopId. The acttion performed could be represented as pow(2, $iShopId - 1) We use mySQL to calculate that, as currently php int size is only 32 bit.
int | $iShopId current shop id |
Definition at line 825 of file oxutils.php.
oxUtils.handlePageNotFoundError | ( | $ | sUrl = '' |
) |
handler for 404 (page not found) error
string | $sUrl url wich was given, can be not specified in some cases |
Definition at line 1278 of file oxutils.php.
oxUtils.isSearchEngine | ( | $ | sClient = null |
) |
Checks if current web client is Search Engine. Returns true on success.
string | $sClient user browser agent |
Definition at line 266 of file oxutils.php.
oxUtils.isValidAlpha | ( | $ | sField | ) |
Checks if string is only alpha numeric symbols
string | $sField fieldname to test |
Definition at line 878 of file oxutils.php.
oxUtils.isValidEmail | ( | $ | sEmail | ) |
User email validation function. Returns true if email is OK otherwise - false; Syntax validation is performed only.
string | $sEmail user email |
Definition at line 318 of file oxutils.php.
oxUtils.loadAdminProfile | ( | $ | aInterfaceProfiles | ) |
Parses profile configuration, loads stored info in cookie
array | $aInterfaceProfiles ($myConfig->getConfigParam( 'aInterfaceProfiles' )) |
Definition at line 352 of file oxutils.php.
oxUtils.logger | ( | $ | sText, | |
$ | blNewline = false | |||
) |
Processes logging.
string | $sText Log message text | |
bool | $blNewline If true, writes message to new line (default false) |
Definition at line 1102 of file oxutils.php.
oxUtils.oxMimeContentType | ( | $ | sFileName | ) |
returns manually set mime types
string | $sFileName the file |
Definition at line 1068 of file oxutils.php.
oxUtils.oxResetFileCache | ( | ) |
Removes most files stored in cache (default 'tmp') folder. Some files e.g. table fiels names description, are left. Excluded cache file name patterns are defined in oxutils._sPermanentCachePattern parameter
Definition at line 639 of file oxutils.php.
oxUtils.prepareUrlForNoSession | ( | $ | sUrl | ) |
prepareUrlForNoSession adds extra url params making it usable without session also removes sid=xxxx&
string | $sUrl given url |
Definition at line 1153 of file oxutils.php.
oxUtils.rebuildCache | ( | ) |
oxUtils.redirect | ( | $ | sUrl, | |
$ | blAddRedirectParam = true , |
|||
$ | iHeaderCode = 301 | |||
) |
redirect user to the specified URL
string | $sUrl URL to be redirected | |
bool | $blAddRedirectParam add "redirect" param | |
int | $iHeaderCode header code, default 301 |
Definition at line 908 of file oxutils.php.
oxUtils.seoIsActive | ( | $ | blReset = false , |
|
$ | sShopId = null , |
|||
$ | iActLang = null | |||
) |
Checks if Seo mode should be used
bool | $blReset used to reset cached SEO mode | |
string | $sShopId shop id (optional; if not passed active session shop id will be used) | |
int | $iActLang language id (optional; if not passed active session language will be used) |
Definition at line 792 of file oxutils.php.
oxUtils.setHeader | ( | $ | sHeader | ) |
set header sent to browser
string | $sHeader header to sent |
Definition at line 974 of file oxutils.php.
oxUtils.setLangCache | ( | $ | sCacheName, | |
$ | aLangCache | |||
) |
Writes languge array to file cache
string | $sCacheName name of cache file | |
array | $aLangCache language array |
Definition at line 1227 of file oxutils.php.
oxUtils.showMessageAndExit | ( | $ | sMsg | ) |
shows given message and quits
string | $sMsg message to show |
Definition at line 955 of file oxutils.php.
oxUtils.stripGpcMagicQuotes | ( | ) |
oxUtils.strMan | ( | $ | sVal, | |
$ | sKey = null | |||
) |
OXID specific string manipulation method
string | $sVal string | |
string | $sKey key |
Definition at line 126 of file oxutils.php.
oxUtils.strRem | ( | $ | sVal, | |
$ | sKey = null | |||
) |
OXID specific string manipulation method
string | $sVal string | |
string | $sKey key |
Definition at line 148 of file oxutils.php.
oxUtils.strRot13 | ( | $ | sStr | ) |
Applies ROT13 encoding to $sStr
string | $sStr to encoding string |
Definition at line 1134 of file oxutils.php.
oxUtils.toFileCache | ( | $ | sKey, | |
$ | mContents | |||
) |
Adds contents to cache contents by given key. Returns true on success. All file caches are supposed to be written once by commitFileCache() method.
string | $sKey Cache key | |
mixed | $mContents Contents to cache |
Definition at line 549 of file oxutils.php.
oxUtils.toPhpFileCache | ( | $ | sKey, | |
$ | mContents | |||
) |
Generates php file, which could later be loaded as include instead of paresed data. Currenntly this method supports simple arrays only.
string | $sKey Cache key | |
mixed | $mContents Cache contents. At this moment only simple array type is supported. |
Definition at line 483 of file oxutils.php.
oxUtils.toStaticCache | ( | $ | sName, | |
$ | sContent, | |||
$ | sKey = null | |||
) |
Stores something into static cache to avoid double loading
string | $sName name of the content | |
mixed | $sContent the content | |
string | $sKey optional key, where to store the content |
Definition at line 433 of file oxutils.php.
oxUtils.writeToLog | ( | $ | sLogMessage, | |
$ | sLogFileName | |||
) |
Writes given log message. Returns write state
string | $sLogMessage log message | |
string | $sLogFileName log file name |
Definition at line 1258 of file oxutils.php.
oxUtils.$_aFileCacheContents = array() [protected] |
Definition at line 49 of file oxutils.php.
oxUtils.$_aFileCacheWritable = array() [protected] |
Definition at line 56 of file oxutils.php.
oxUtils.$_aStaticCache [protected] |
Definition at line 93 of file oxutils.php.
oxUtils.$_blIsSe = null [protected] |
Definition at line 63 of file oxutils.php.
oxUtils.$_blSeoIsActive = null [protected] |
Definition at line 100 of file oxutils.php.
oxUtils.$_iCurPrecision = null [protected] |
Definition at line 26 of file oxutils.php.
oxUtils.$_instance = null [static, private] |
Definition at line 19 of file oxutils.php.
oxUtils.$_sEmailTpl = "/^([-!#\$%&'*+.\/0-9=?A-Z^_`a-z{|}~\177])+@([-!#\$%&'*+\/0-9=?A-Z^_`a-z{|}~\177]+\\.)+[a-zA-Z]{2,6}\$/i" [protected] |
Definition at line 33 of file oxutils.php.
oxUtils.$_sPermanentCachePattern = "/c_fieldnames_/" [protected] |
Definition at line 42 of file oxutils.php.