oxUtils Class Reference

Inheritance diagram for oxUtils:

Inheritance graph
[legend]
Collaboration diagram for oxUtils:

Collaboration graph
[legend]

List of all members.


Detailed Description

Includes Smarty engine class. general utils class, used as a singelton

Definition at line 12 of file oxutils.php.


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)
 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)
 showMessageAndExit ($sMsg)
 setHeader ($sHeader)
 oxMimeContentType ($sFileName)
 logger ($sText, $blNewline=false)
 strRot13 ($sStr)
 prepareUrlForNoSession ($sUrl)
 getLangCache ($sCacheName)
 setLangCache ($sCacheName, $aLangCache)
 checkUrlEndingSlash ($sUrl)

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()
 $_aStaticCache
 $_blSeoIsActive = null

Static Private Attributes

static $_instance = null

Member Function Documentation

static oxUtils.getInstance (  )  [static]

resturns a single instance of this class

Returns:
oxUtils

Definition at line 56 of file oxutils.php.

oxUtils.stripGpcMagicQuotes (  ) 

Strips magic quotes

Returns:
null

Definition at line 96 of file oxutils.php.

oxUtils.strMan ( sVal,
sKey = null 
)

OXID specific string manipulation method

Parameters:
string $sVal string
string $sKey key
Returns:
string

Definition at line 115 of file oxutils.php.

oxUtils.strRem ( sVal,
sKey = null 
)

OXID specific string manipulation method

Parameters:
string $sVal string
string $sKey key
Returns:
string

Definition at line 137 of file oxutils.php.

oxUtils.getArrFldName ( sName  ) 

Returns string witch "." symbols were replaced with "__".

Parameters:
string $sName String to search replaceble char
Returns:
string

Definition at line 158 of file oxutils.php.

oxUtils.assignValuesFromText ( sIn,
dVat = null 
)

Takes a string and assign all values, returns array with values.

Parameters:
string $sIn Initial string
double $dVat Article VAT (optional)
Returns:
array

Definition at line 171 of file oxutils.php.

oxUtils.assignValuesToText ( aIn  ) 

Takes an array and builds again a string. Returns string with values.

Parameters:
array $aIn Initial array of strings
Returns:
string

Definition at line 193 of file oxutils.php.

oxUtils.formatCurrency ( dValue,
oActCur = null 
)

Returns formatted currency string, according to formatting standards.

Deprecated:
use oxLang.formatCurrency
Parameters:
double $dValue Plain price
object $oActCur Object of active currency
Returns:
string

Definition at line 216 of file oxutils.php.

oxUtils.currency2Float ( sValue  ) 

Returns formatted currency string, according to formatting standards.

Parameters:
string $sValue Formatted price
Returns:
string

Definition at line 233 of file oxutils.php.

oxUtils.isSearchEngine ( sClient = null  ) 

Checks if current web client is Search Engine. Returns true on success.

Parameters:
string $sClient user browser agent
Returns:
bool

Definition at line 255 of file oxutils.php.

oxUtils.isValidEmail ( sEmail  ) 

User email validation function. Returns true if email is OK otherwise - false; Syntax validation is performed only.

Parameters:
string $sEmail user email
Returns:
bool

Definition at line 296 of file oxutils.php.

oxUtils.rebuildCache (  ) 

Clears Smarty cache data.

Returns:
null

Definition at line 311 of file oxutils.php.

oxUtils.loadAdminProfile ( aInterfaceProfiles  ) 

Parses profile configuration, loads stored info in cookie

Parameters:
array $aInterfaceProfiles ($myConfig->getConfigParam( 'aInterfaceProfiles' ))
Returns:
null

Definition at line 330 of file oxutils.php.

oxUtils.fRound ( sVal,
oCur = null 
)

Rounds the value to currency cents

Parameters:
string $sVal the value that should be rounded
object $oCur Currenncy Object
Returns:
float

Definition at line 366 of file oxutils.php.

oxUtils.toStaticCache ( sName,
sContent,
sKey = null 
)

Stores something into static cache to avoid double loading

Parameters:
string $sName name of the content
mixed $sContent the content
string $sKey optional key, where to store the content
Returns:
null

Definition at line 410 of file oxutils.php.

oxUtils.fromStaticCache ( sName  ) 

Retrieves something from static cache

Parameters:
string $sName name under which the content is stored in the satic cache
Returns:
mixed

Definition at line 427 of file oxutils.php.

oxUtils.cleanStaticCache ( sCacheName = null  ) 

Cleans all or specific data from static cache

Parameters:
string $sCacheName Cache name
Returns:
null

Definition at line 442 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.

Parameters:
string $sKey Cache key
mixed $,Contents Contents to cache
Returns:
bool

Definition at line 461 of file oxutils.php.

oxUtils.fromFileCache ( sKey  ) 

Fetches contents from file cache.

Parameters:
string $sKey Cache key
Returns:
mixed

Definition at line 498 of file oxutils.php.

oxUtils.commitFileCache (  ) 

Writes all cache contents to file at once. This method was introduced due to possible race conditions

Returns:
null;

Definition at line 524 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

Returns:
null

Definition at line 549 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

Parameters:
string $sRemote the file
string $sLocal the adress of the remote source
Returns:
mixed

Definition at line 570 of file oxutils.php.

oxUtils.checkAccessRights (  ) 

This function checks if logged in user has access to admin or not

Returns:
bool

Definition at line 618 of file oxutils.php.

oxUtils.seoIsActive ( blReset = false,
sShopId = null,
iActLang = null 
)

Checks if Seo mode should be used

Parameters:
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)
Returns:
bool

Definition at line 698 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.

Parameters:
int $iShopId current shop id
Returns:
int

Definition at line 734 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.

Parameters:
int $iVal1 value nr 1
int $iVal2 value nr 2
Returns:
int

Definition at line 753 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.

Parameters:
int $iVal1 value nr 1
int $iVal2 value nr 2
Returns:
int

Definition at line 771 of file oxutils.php.

oxUtils.isValidAlpha ( sField  ) 

Checks if string is only alpha numeric symbols

Parameters:
string $sField fieldname to test
Returns:
bool

Definition at line 787 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

Parameters:
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
Returns:
null

Definition at line 801 of file oxutils.php.

oxUtils.redirect ( sUrl,
blAddRedirectParam = true 
)

redirect user to the specified URL

Parameters:
string $sUrl URL to be redirected
bool $blAddRedirectParam add "redirect" param
Returns:
null or exit

Definition at line 816 of file oxutils.php.

oxUtils.showMessageAndExit ( sMsg  ) 

shows given message and quits

Parameters:
string $sMsg message to show
Returns:
null dies

Definition at line 852 of file oxutils.php.

oxUtils.setHeader ( sHeader  ) 

set header sent to browser

Parameters:
string $sHeader header to sent
Returns:
null

Definition at line 870 of file oxutils.php.

oxUtils._addUrlParameters ( sUrl,
aParams 
) [protected]

adds the given paramters at the end of the given url

Parameters:
string $sUrl a url
array $aParams the params which will be added
Returns:
string

Definition at line 883 of file oxutils.php.

oxUtils._fillExplodeArray ( aName,
dVat = null 
) [protected]

Fill array.

Parameters:
array $aName Initial array of strings
double $dVat Article VAT
Returns:
string

Definition at line 905 of file oxutils.php.

oxUtils.oxMimeContentType ( sFileName  ) 

returns manually set mime types

Parameters:
string $sFileName the file
Returns:
string

Definition at line 964 of file oxutils.php.

oxUtils.logger ( sText,
blNewline = false 
)

Processes logging.

Parameters:
string $sText Log message text
bool $blNewline If true, writes message to new line (default false)
Returns:
null

Definition at line 998 of file oxutils.php.

oxUtils._stripQuotes ( mInput  )  [protected]

Recursively removes slashes from arrays

Parameters:
mixed $mInput the input from which the slashes should be removed
Returns:
mixed

Definition at line 1017 of file oxutils.php.

oxUtils.strRot13 ( sStr  ) 

Applies ROT13 encoding to $sStr

Parameters:
string $sStr to encoding string
Returns:
string

Definition at line 1029 of file oxutils.php.

oxUtils.prepareUrlForNoSession ( sUrl  ) 

prepareUrlForNoSession adds extra url params making it usable without session also removes sid=xxxx&

Parameters:
string $sUrl given url
public
Returns:
string

Definition at line 1047 of file oxutils.php.

oxUtils._getCacheFilePath ( sCacheName,
blPathOnly = false 
) [protected]

Returns full path (including file name) to cache file

Parameters:
string $sCacheName cache file name
bool $blPathOnly if TRUE, name parameter will be ignored and only cache folder will be returned (default FALSE)
Returns:
string

Definition at line 1090 of file oxutils.php.

oxUtils.getLangCache ( sCacheName  ) 

Tries to load lang cache array from cache file

Parameters:
string $sCacheName cache file name
Returns:
array

Definition at line 1108 of file oxutils.php.

oxUtils.setLangCache ( sCacheName,
aLangCache 
)

Writes languge array to file cache

Parameters:
string $sCacheName name of cache file
array $aLangCache language array
Returns:
null

Definition at line 1126 of file oxutils.php.

oxUtils.checkUrlEndingSlash ( sUrl  ) 

Cheks if url has ending slash / - if not, adds it

Parameters:
string $sUrl url string
Returns:
string

Definition at line 1140 of file oxutils.php.


Member Data Documentation

oxUtils.$_instance = null [static, private]

Definition at line 19 of file oxutils.php.

oxUtils.$_iCurPrecision = null [protected]

Definition at line 26 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.

oxUtils.$_aFileCacheContents = array() [protected]

Definition at line 49 of file oxutils.php.

oxUtils.$_aStaticCache [protected]

Definition at line 82 of file oxutils.php.

oxUtils.$_blSeoIsActive = null [protected]

Definition at line 89 of file oxutils.php.


The documentation for this class was generated from the following file:

Generated on Tue Aug 18 09:26:12 2009 for OXID eShop CE by  doxygen 1.5.5