VirtueMart  3.2.14.9808
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
JCacheStorageVmfile Class Reference
Inheritance diagram for JCacheStorageVmfile:
Inheritance graph
[legend]
Collaboration diagram for JCacheStorageVmfile:
Collaboration graph
[legend]

Public Member Functions

 __construct ($options=array())
 
 get ($id, $group, $checkTime=true)
 
 getAll ()
 
 store ($id, $group, $data)
 
 remove ($id, $group)
 
 clean ($group, $mode=null)
 
 gc ()
 
 lock ($id, $group, $locktime)
 
 unlock ($id, $group=null)
 

Static Public Member Functions

static test ()
 

Protected Member Functions

 _checkExpire ($id, $group)
 
 _getFilePath ($id, $group)
 
 _deleteFolder ($path)
 
 _cleanPath ($path, $ds=DIRECTORY_SEPARATOR)
 
 _filesInFolder ($path, $filter= '.', $recurse=false, $fullpath=false, $exclude=array('.svn', 'CVS', '.DS_Store', '__MACOSX'), $excludefilter=array('^\..*', '.*~'))
 
 _folders ($path, $filter= '.', $recurse=false, $fullpath=false, $exclude=array('.svn', 'CVS', '.DS_Store', '__MACOSX'), $excludefilter=array('^\..*'))
 

Protected Attributes

 $_root
 

Constructor & Destructor Documentation

JCacheStorageVmfile::__construct (   $options = array())

Constructor

Parameters
array$optionsOptional parameters
Since
11.1

Member Function Documentation

JCacheStorageVmfile::_checkExpire (   $id,
  $group 
)
protected

Check to make sure cache is still valid, if not, delete it.

Parameters
string$idCache key to expire.
string$groupThe cache data group.
Returns
boolean False if not valid
Since
11.1
JCacheStorageVmfile::_cleanPath (   $path,
  $ds = DIRECTORY_SEPARATOR 
)
protected

Function to strip additional / or \ in a path name

Parameters
string$pathThe path to clean
string$dsDirectory separator (optional)
Returns
string The cleaned path
Since
11.1
JCacheStorageVmfile::_deleteFolder (   $path)
protected

Quickly delete a folder of files

Parameters
string$pathThe path to the folder to delete.
Returns
boolean True on success.
Since
11.1
JCacheStorageVmfile::_filesInFolder (   $path,
  $filter = '.',
  $recurse = false,
  $fullpath = false,
  $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX'),
  $excludefilter = array('^\..*', '.*~') 
)
protected

Utility function to quickly read the files in a folder.

Parameters
string$pathThe path of the folder to read.
string$filterA filter for file names.
mixed$recurseTrue to recursively search into sub-folders, or an integer to specify the maximum depth.
boolean$fullpathTrue to return the full path to the file.
array$excludeArray with names of files which should not be shown in the result.
array$excludefilterArray of folder names to exclude
Returns
array Files in the given folder.
Since
11.1
JCacheStorageVmfile::_folders (   $path,
  $filter = '.',
  $recurse = false,
  $fullpath = false,
  $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX'),
  $excludefilter = array('^\..*') 
)
protected

Utility function to read the folders in a folder.

Parameters
string$pathThe path of the folder to read.
string$filterA filter for folder names.
mixed$recurseTrue to recursively search into sub-folders, or an integer to specify the maximum depth.
boolean$fullpathTrue to return the full path to the folders.
array$excludeArray with names of folders which should not be shown in the result.
array$excludefilterArray with regular expressions matching folders which should not be shown in the result.
Returns
array Folders in the given folder.
Since
11.1
JCacheStorageVmfile::_getFilePath (   $id,
  $group 
)
protected

Get a cache file path from an id/group pair

Parameters
string$idThe cache data id
string$groupThe cache data group
Returns
string The cache file path
Since
11.1
JCacheStorageVmfile::clean (   $group,
  $mode = null 
)

Clean cache for a group given a mode.

Parameters
string$groupThe cache data group
string$modeThe mode for cleaning cache [group|notgroup] group mode : cleans all cache in the group notgroup mode : cleans all cache not in the group
Returns
boolean True on success, false otherwise
Since
11.1
JCacheStorageVmfile::gc ( )

Garbage collect expired cache data

Returns
boolean True on success, false otherwise.
Since
11.1
JCacheStorageVmfile::get (   $id,
  $group,
  $checkTime = true 
)

Get cached data from a file by id and group

Parameters
string$idThe cache data id
string$groupThe cache data group
boolean$checkTimeTrue to verify cache time expiration threshold
Returns
mixed Boolean false on failure or a cached data string
Since
11.1
JCacheStorageVmfile::getAll ( )

Get all cached data

Returns
array The cached data
Since
11.1
JCacheStorageVmfile::lock (   $id,
  $group,
  $locktime 
)

Lock cached item

Parameters
string$idThe cache data id
string$groupThe cache data group
integer$locktimeCached item max lock time
Returns
boolean True on success, false otherwise.
Since
11.1
JCacheStorageVmfile::remove (   $id,
  $group 
)

Remove a cached data file by id and group

Parameters
string$idThe cache data id
string$groupThe cache data group
Returns
boolean True on success, false otherwise
Since
11.1
JCacheStorageVmfile::store (   $id,
  $group,
  $data 
)

Store the data to a file by id and group

Parameters
string$idThe cache data id
string$groupThe cache data group
string$dataThe data to store in cache
Returns
boolean True on success, false otherwise
Since
11.1
static JCacheStorageVmfile::test ( )
static

Test to see if the cache storage is available.

Returns
boolean True on success, false otherwise.
Since
11.1
JCacheStorageVmfile::unlock (   $id,
  $group = null 
)

Unlock cached item

Parameters
string$idThe cache data id
string$groupThe cache data group
Returns
boolean True on success, false otherwise.
Since
11.1

Member Data Documentation

JCacheStorageVmfile::$_root
protected

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