apidoc
[ class tree: apidoc ] [ index: apidoc ] [ all elements ]

Class: Cache_Lite

Source Location: /Cache_Lite-1.8.0/Cache/Lite.php

Class Overview




Methods


Child classes:

Inherited Variables

Inherited Methods


Class Details

[line 29]


[ Top ]


Method Detail

__construct (Constructor)   [line 297]

Cache_Lite __construct( [array $options = array(NULL)])

Constructor

$options is an assoc. Available options are : $options = array( 'cacheDir' => directory where to put the cache files (string), 'caching' => enable / disable caching (boolean), 'lifeTime' => cache lifetime in seconds (int), 'fileLocking' => enable / disable fileLocking (boolean), 'writeControl' => enable / disable write control (boolean), 'readControl' => enable / disable read control (boolean), 'readControlType' => type of read control 'crc32', 'md5', 'strlen' (string), 'pearErrorMode' => pear error mode (when raiseError is called) (cf PEAR doc) (int), 'memoryCaching' => enable / disable memory caching (boolean), 'onlyMemoryCaching' => enable / disable only memory caching (boolean), 'memoryCachingLimit' => max nbr of records to store into memory caching (int), 'fileNameProtection' => enable / disable automatic file name protection (boolean), 'automaticSerialization' => enable / disable automatic serialization (boolean), 'automaticCleaningFactor' => distable / tune automatic cleaning process (int), 'hashedDirectoryLevel' => level of the hashed directory system (int), 'hashedDirectoryUmask' => umask for hashed directory structure (int), 'errorHandlingAPIBreak' => API break for better error handling ? (boolean) 'hashedDirectoryGroup' => group of hashed directory structure (int | string) (see function chgrp) 'cacheFileMode' => filesystem mode of newly created cache files (int) 'cacheFileGroup' => group of newly created cache files (int | string) (see function chgrp) );

If sys_get_temp_dir() is available and the 'cacheDir' option is not provided in the constructor options array its output is used to determine the suitable temporary directory.


Overridden in child classes as:

Cache_Lite_Function::__construct()
Constructor
Cache_Lite_File::__construct()
Constructor
Cache_Lite_Output::__construct()
Constructor

Parameters:

array   $options   —  options

[ Top ]

Cache_Lite (Constructor)   [line 312]

Cache_Lite Cache_Lite( [array $options = array(NULL)])

PHP4 constructor for backwards compatibility with older code

Parameters:

array   $options   —  Options

[ Top ]

clean   [line 474]

boolean clean( [string $group = false], [string $mode = 'ingroup'])

Clean the cache

if no group is specified all cache files will be destroyed else only cache files of the specified group will be destroyed

  • Return: true if no problem
  • Access: public

Parameters:

string   $group   —  name of the cache group
string   $mode   —  flush cache mode : 'old', 'ingroup', 'notingroup', 'callback_myFunction'

[ Top ]

extendLife   [line 578]

void extendLife( )

Extend the life of a valid cache file

see http://pear.php.net/bugs/bug.php?id=6681

  • Access: public

[ Top ]

get   [line 344]

string get( string $id, [string $group = 'default'], [boolean $doNotTestCacheValidity = false])

Test if a cache is available and (if yes) return it
  • Return: data of the cache (else : false)
  • Access: public

Overridden in child classes as:

Cache_Lite_File::get()
Test if a cache is available and (if yes) return it

Parameters:

string   $id   —  cache id
string   $group   —  name of the cache group
boolean   $doNotTestCacheValidity   —  if set to true, the cache validity won't be tested

[ Top ]

getMemoryCachingState   [line 531]

void getMemoryCachingState( string $id, [string $group = 'default'], [boolean $doNotTestCacheValidity = false])

Load the state of the caching memory array from a given cache file cache
  • Access: public

Parameters:

string   $id   —  cache id
string   $group   —  name of the cache group
boolean   $doNotTestCacheValidity   —  if set to true, the cache validity won't be tested

[ Top ]

lastModified   [line 549]

int lastModified( )

Return the cache last modification time

BE CAREFUL : THIS METHOD IS FOR HACKING ONLY !

  • Return: last modification time

[ Top ]

raiseError   [line 565]

void raiseError( string $msg, int $code)

Trigger a PEAR error

To improve performances, the PEAR.php file is included dynamically. The file is so included only when an error is triggered. So, in most cases, the file isn't included and perfs are much better.

  • Access: public

Parameters:

string   $msg   —  error message
int   $code   —  error code

[ Top ]

remove   [line 444]

boolean remove( string $id, [string $group = 'default'], [boolean $checkbeforeunlink = false])

Remove a cache file
  • Return: true if no problem
  • Access: public

Parameters:

string   $id   —  cache id
string   $group   —  name of the cache group
boolean   $checkbeforeunlink   —  check if file exists before removing it

[ Top ]

save   [line 393]

boolean save( string $data, [string $id = NULL], [string $group = 'default'])

Save some data in a cache file
  • Return: true if no problem (else : false or a PEAR_Error object)
  • Access: public

Parameters:

string   $data   —  data to put in cache (can be another type than strings if automaticSerialization is on)
string   $id   —  cache id
string   $group   —  name of the cache group

[ Top ]

saveMemoryCachingState   [line 511]

void saveMemoryCachingState( string $id, [string $group = 'default'])

Save the state of the caching memory array into a cache file cache
  • Access: public

Parameters:

string   $id   —  cache id
string   $group   —  name of the cache group

[ Top ]

setLifeTime   [line 498]

void setLifeTime( int $newLifeTime)

Set a new life time
  • Access: public

Parameters:

int   $newLifeTime   —  new life time (in seconds)

[ Top ]

setOption   [line 326]

void setOption( $name, $value)

Generic way to set a Cache_Lite option

see Cache_Lite constructor for available options

  • Var: name of the option
  • Access: public

Parameters:

   $name   — 
   $value   — 

[ Top ]

setToDebug   [line 487]

void setToDebug( )

Set to debug mode

When an error is found, the script will stop and the message will be displayed (in debug mode only).

  • Access: public

[ Top ]


Documentation generated on Mon, 04 Jul 2016 05:30:02 +0000 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.