Phpfox_Cache_Abstract

Description

Implements interfaces:

Abstract class for cache storage classes. This class is used to work with the cache system and certain methods do not require to work with a specific storage.

Example of deleting static JavaScript & CSS files:

  1.  Phpfox::getLib('cache')->removeStatic('sample.css');

  • author: Raymond Benc
  • version: $Id: abstract.class.php 1687 2010-07-22 03:13:27Z Raymond_Benc $
  • copyright: [PHPFOX_COPYRIGHT]
  • abstract:

Located in /include/library/phpfox/cache/abstract.class.php (line 25)


	
			
Direct descendents
Class Description
 class Phpfox_Cache_Storage_File File Cache Layer - This class handles the cache routine for phpFox and can store arrays, strings and objects. All the data is stored in a flat file which has a unique id. Data is also serilazed before its stored in the flat file.
 class Phpfox_Cache_Storage_Memcache Memcached Cache Layer - This class handles the cache routine for phpFox and can store arrays, strings and objects. All the data is stored in memcached which has a unique id. Data is also serilazed before its stored.
Variable Summary
 array $_aParams
 unknown_type $_aStats
Method Summary
 Phpfox_Cache_Abstract __construct ([array $aParams = array()])
 array getAll ()
 string getData (int $iId)
 array getStatic ()
 array getStats ()
 void lock ()
 void removeInfo (bool $sFile)
 bool removeStatic ([string $sFile = null])
 null saveInfo (string $sFile, string $sType, string $sContent, int $iSize)
 void unlock ()
 mixed _getParam (string $sParam)
Variables
array $_aParams = array() (line 32)

Array of any special params we pass in case we need to do something.

  • access: protected
unknown_type $_aStats = array() (line 39)

Array of stats holding the information about the cache files

  • access: protected
Methods
Constructor __construct (line 46)

Load all the custom params in a protected variable array.

  • access: public
Phpfox_Cache_Abstract __construct ([array $aParams = array()])
  • array $aParams: Optional array of custom params

Redefined in descendants as:
getAll (line 97)

List of all the cache files found within the "file/cache/" folder.

  • return: Array of all the files found within the "file/cache/" folder.
  • staticvar: array $aFiles: Hold all the files from the cache folder.
  • access: public
array getAll ()
getData (line 235)

Get all the information of the cache file from the database to check if the file is cached.

NOTICE: We are not using this method anymore.

  • return: Data of the cache file.
  • deprecated: Deprecated since version 2.0.1
  • access: public
string getData (int $iId)
  • int $iId: ID of the cache file.
getStatic (line 56)

Returns all the static javascript and css files we have saved using the cache system.

  • return: List of cached files within the "file/static/" folder.
  • access: public
array getStatic ()
getStats (line 86)

Get all the stats about the cache storage system.

  • access: public
array getStats ()
lock (line 260)

Lock the cache system. When the cache system is locked you will not be able to cache anything new until it is unlocked.

  • see: self::unlock()
  • access: public
void lock ()
removeInfo (line 213)

Removes information from the database that the cache file is not cached any longer.

NOTICE: We are not using this method anymore.

  • deprecated: Deprecated since version 2.0.1
  • access: public
void removeInfo (bool $sFile)
  • bool $sFile: Nothing to do, we don't use this method anymore.
removeStatic (line 143)

Removes a static javascript or css file.

  • return: Returns true if we were able to delete the file.
  • access: public
bool removeStatic ([string $sFile = null])
  • string $sFile: Name of the static file. If nothing is passed then we delete all the files found within the "file/static/" folder.
saveInfo (line 180)

Stores all the cache information in the database for stats.

NOTICE: We are not using this method anymore.

  • return: Exit the function we need need to skip it
  • deprecated: Deprecated since version 2.0.1
  • access: public
null saveInfo (string $sFile, string $sType, string $sContent, int $iSize)
  • string $sFile: Name of the file
  • string $sType: Type of cache file
  • string $sContent: serialized data to store in the database
  • int $iSize: Size of the serialized data
unlock (line 269)

Unlock the cache system.

  • access: public
void unlock ()
_getParam (line 283)

Get a params value in case we pass any information to this class when it was first constructed.

  • return: Returns the params value if it exists, if not we null it.
  • access: protected
mixed _getParam (string $sParam)
  • string $sParam: Name of the param

Documentation generated on Tue, 28 Sep 2010 10:36:36 +0200 by phpDocumentor 1.4.0a2