Ubiquity  2.0.0
php rapid development framework
AbstractDataCache Class Reference

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

+ Inheritance diagram for AbstractDataCache:

Public Member Functions

 __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)
 

Data Fields

const PHP_TAG ="<?php\n"
 

Protected Member Functions

 storeContent ($key, $content, $tag)
 

Protected Attributes

 $_root
 
 $postfix
 

Detailed Description

This class is responsible for storing Arrays in PHP files.

Definition at line 11 of file AbstractDataCache.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $root,
  $postfix = "" 
)

Definition at line 23 of file AbstractDataCache.php.

Member Function Documentation

◆ clear()

clear ( )
abstract

Clears all cache entries.

◆ clearCache()

clearCache (   $type)
abstract

◆ exists()

exists (   $key)
abstract

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

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

◆ expired()

expired (   $key,
  $duration 
)

Definition at line 34 of file AbstractDataCache.php.

◆ fetch()

fetch (   $key)
abstract

Fetches data stored for the given key.

Parameters
string$keycache key
Returns
mixed the cached data

◆ file_get_contents()

file_get_contents (   $key)
abstract

return data stored for the given key.

Parameters
string$keycache key
Returns
mixed the cached data

◆ getCacheFiles()

getCacheFiles (   $type)
abstract

◆ getCacheInfo()

getCacheInfo ( )

Definition at line 104 of file AbstractDataCache.php.

◆ getEntryKey()

getEntryKey (   $key)
abstract

◆ getRoot()

getRoot ( )

Definition at line 62 of file AbstractDataCache.php.

◆ getTimestamp()

getTimestamp (   $key)
abstract

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

Parameters
string$keycache key
Returns
boolean|int unix timestamp

◆ remove()

remove (   $key)
abstract
Parameters
string$key

◆ store()

store (   $key,
  $code,
  $tag = null,
  $php = true 
)

Caches the given data with the given key.

Parameters
string$keycache key
string$codethe source-code to be cached
stringtag the item tag
boolean$php
Exceptions
AnnotationExceptionif file could not be written

Definition at line 54 of file AbstractDataCache.php.

◆ storeContent()

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

Field Documentation

◆ $_root

$_root
protected

Definition at line 19 of file AbstractDataCache.php.

◆ $postfix

$postfix
protected

Definition at line 21 of file AbstractDataCache.php.

◆ PHP_TAG

const PHP_TAG ="<?php\n"

Definition at line 16 of file AbstractDataCache.php.


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