Ubiquity  2.0.2
php rapid development framework
ArrayCache Class Reference

This class is responsible for storing Arrays in PHP files. More...

+ Inheritance diagram for ArrayCache:

Public Member Functions

 __construct ($root, $postfix="", $cacheParams=[])
 Initializes the file cache-provider. More...
 
 exists ($key)
 Check if annotation-data for the key has been stored. More...
 
 fetch ($key)
 Fetches data stored for the given key. More...
 
 file_get_contents ($key)
 return data stored for the given key. More...
 
 getTimestamp ($key)
 Returns the timestamp of the last cache update for the given key. More...
 
 remove ($key)
 {} More...
 
 clear ($matches="")
 {} More...
 
 getCacheFiles ($type)
 {} More...
 
 clearCache ($type)
 {} More...
 
 getCacheInfo ()
 {} More...
 
 getEntryKey ($key)
 {} More...
 
- Public Member Functions inherited from AbstractDataCache
 __construct ($root, $postfix="")
 
 exists ($key)
 Check if annotation-data for the key has been stored. More...
 
 expired ($key, $duration)
 
 store ($key, $code, $tag=null, $php=true)
 Caches the given data with the given key. More...
 
 getRoot ()
 
 fetch ($key)
 Fetches data stored for the given key. More...
 
 file_get_contents ($key)
 return data stored for the given key. More...
 
 getTimestamp ($key)
 Returns the timestamp of the last cache update for the given key. More...
 
 remove ($key)
 
 clear ()
 Clears all cache entries. More...
 
 getCacheFiles ($type)
 
 clearCache ($type)
 
 getCacheInfo ()
 
 getEntryKey ($key)
 

Protected Member Functions

 storeContent ($key, $content, $tag)
 Caches the given data with the given key. More...
 
- Protected Member Functions inherited from AbstractDataCache
 storeContent ($key, $content, $tag)
 

Private Member Functions

 _getPath ($key)
 Maps a cache-key to the absolute path of a PHP file. More...
 

Private Attributes

 $_fileMode
 

Additional Inherited Members

- Data Fields inherited from AbstractDataCache
const PHP_TAG ="<?php\n"
 
- Protected Attributes inherited from AbstractDataCache
 $_root
 
 $postfix
 

Detailed Description

This class is responsible for storing Arrays in PHP files.

Definition at line 13 of file ArrayCache.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $root,
  $postfix = "",
  $cacheParams = [] 
)

Initializes the file cache-provider.

Parameters
string$rootabsolute path to the root-folder where cache-files will be stored
string$postfixTermination of file names
array$cacheParamsdefaults to ["fileMode"=>"0777"]

Definition at line 26 of file ArrayCache.php.

Member Function Documentation

◆ _getPath()

_getPath (   $key)
private

Maps a cache-key to the absolute path of a PHP file.

Parameters
string$keycache key
Returns
string absolute path of the PHP file

Definition at line 92 of file ArrayCache.php.

◆ clear()

clear (   $matches = "")

{}

See also
::clear()

Definition at line 113 of file ArrayCache.php.

◆ clearCache()

clearCache (   $type)

{}

See also
::clearCache()

Definition at line 138 of file ArrayCache.php.

◆ exists()

exists (   $key)

Check if annotation-data for the key has been stored.

Parameters
string$keycache key
Returns
boolean true if data with the given key has been stored; otherwise false

Definition at line 38 of file ArrayCache.php.

◆ fetch()

fetch (   $key)

Fetches data stored for the given key.

Parameters
string$keycache key
Returns
mixed the cached data

Definition at line 63 of file ArrayCache.php.

◆ file_get_contents()

file_get_contents (   $key)

return data stored for the given key.

Parameters
string$keycache key
Returns
mixed the cached data

Definition at line 72 of file ArrayCache.php.

◆ getCacheFiles()

getCacheFiles (   $type)

{}

See also
::getCacheFiles()

Definition at line 126 of file ArrayCache.php.

◆ getCacheInfo()

getCacheInfo ( )

{}

See also
::getCacheInfo()

Definition at line 147 of file ArrayCache.php.

◆ getEntryKey()

getEntryKey (   $key)

{}

See also
::getEntryKey()

Definition at line 158 of file ArrayCache.php.

◆ getTimestamp()

getTimestamp (   $key)

Returns the timestamp of the last cache update for the given key.

Parameters
string$keycache key
Returns
int unix timestamp

Definition at line 82 of file ArrayCache.php.

◆ remove()

remove (   $key)

{}

See also
::remove()

Definition at line 101 of file ArrayCache.php.

◆ storeContent()

storeContent (   $key,
  $content,
  $tag 
)
protected

Caches the given data with the given key.

Parameters
string$keycache key
string$contentthe source-code to be cached
Exceptions
CacheExceptionif file could not be written

Definition at line 48 of file ArrayCache.php.

Field Documentation

◆ $_fileMode

$_fileMode
private

Definition at line 18 of file ArrayCache.php.


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