PHP Class Horde_Cache_Storage_File, horde

Author: Anil Madhavapeddy ([email protected])
Author: Chuck Hagenbuch ([email protected])
Author: Michael Slusarz ([email protected])
Inheritance: extends Horde_Cache_Storage_Base
ファイルを表示 Open project: horde/horde

Protected Properties

Property Type Description
$_file array List of key to filename mappings.

Public Methods

Method Description
__construct ( array $params = [] ) Constructor.
__destruct ( ) Destructor.
clear ( )
exists ( $key, $lifetime )
expire ( $key )
get ( $key, $lifetime )
set ( $key, $data, $lifetime )

Protected Methods

Method Description
_gc ( ) Garbage collector.
_getCacheFiles ( string $start = null ) : array Return a list of cache files.
_getGCFiles ( ) : array Return a list of GC indexes.
_keyToFile ( string $key, string $create = false ) : string Map a cache key to a unique filename.
_migrateGc ( ) Migrates single GC indexes to per-directory indexes.

Method Details

__construct() public method

Constructor.
public __construct ( array $params = [] )
$params array Optional parameters:
  - dir: (string) The base directory to store the cache files in.
         DEFAULT: System default
  - no_gc: (boolean) If true, don't perform garbage collection.
           DEFAULT: false
  - prefix: (string) The filename prefix to use for the cache files.
            DEFAULT: 'cache_'
  - sub: (integer) If non-zero, the number of subdirectories to create
         to store the file (i.e. PHP's session.save_path).
         DEFAULT: 0

__destruct() public method

Destructor.
public __destruct ( )

_gc() protected method

Garbage collector.
protected _gc ( )

_getCacheFiles() protected method

Return a list of cache files.
protected _getCacheFiles ( string $start = null ) : array
$start string The directory to start searching.
return array Pathnames to cache files.

_getGCFiles() protected method

Return a list of GC indexes.
protected _getGCFiles ( ) : array
return array Pathnames to GC indexes.

_keyToFile() protected method

Map a cache key to a unique filename.
protected _keyToFile ( string $key, string $create = false ) : string
$key string Cache key.
$create string Create path if it doesn't exist?
return string Fully qualified filename.

_migrateGc() protected method

Migrates single GC indexes to per-directory indexes.
protected _migrateGc ( )

clear() public method

public clear ( )

exists() public method

public exists ( $key, $lifetime )

expire() public method

public expire ( $key )

get() public method

public get ( $key, $lifetime )

set() public method

public set ( $key, $data, $lifetime )

Property Details

$_file protected_oe property

List of key to filename mappings.
protected array $_file
return array