Stud.IP  4.0
 All Data Structures Namespaces Files Functions Variables Groups
StudipFileCache Class Reference
Inheritance diagram for StudipFileCache:
StudipSystemCache StudipCache

Public Member Functions

 __construct ($path= '')
 
 getCacheDir ()
 
 expire ($arg)
 
 flush ()
 
 read ($arg)
 
 write ($arg, $content, $expire=self::DEFAULT_EXPIRATION)
 
 purge ($be_quiet=true)
 
 getStats ()
 

Static Public Member Functions

static getDisplayName ()
 
static getConfig ()
 

Additional Inherited Members

- Data Fields inherited from StudipCache
const DEFAULT_EXPIRATION = 12 * 60 * 60
 

Constructor & Destructor Documentation

__construct (   $path = '')

without the 'dir' argument the cache path is taken from $CACHING_FILECACHE_PATH or is set to $TMP_PATH/studip_cache

Parameters
stringthe path to use
Returns
void
Exceptions
exceptionif the directory does not exist or could not be created

Member Function Documentation

expire (   $arg)

expire cache item

See Also
StudipCache::expire()
Parameters
string$arg
Returns
void

Implements StudipCache.

flush ( )

Expire all items from the cache.

Implements StudipCache.

getCacheDir ( )

get path to cache directory

Returns
string
static getConfig ( )
static

Return the Vue component name and props that handle configuration.

See Also
StudipSystemCache::getConfig()
Returns
array

Implements StudipSystemCache.

static getDisplayName ( )
static
Returns
string A translateable display name for this cache class.

Implements StudipSystemCache.

getStats ( )

Return statistics.

::getStats()

Returns
array|array[]

Implements StudipSystemCache.

purge (   $be_quiet = true)

purges expired entries from the cache directory

Parameters
boolecho messages if set to false
Returns
int the number of deleted files
read (   $arg)

retrieve cache item from filesystem tests first if item is expired

See Also
StudipCache::read()
Parameters
string$arga cache key
Returns
string|bool

Implements StudipCache.

write (   $arg,
  $content,
  $expire = self::DEFAULT_EXPIRATION 
)

store data as cache item in filesystem

See Also
StudipCache::write()
Parameters
string$arga cache key
mixed$contentdata to store
int$expireexpiry time in seconds, default 12h
Returns
int|bool the number of bytes that were written to the file, or false on failure

Implements StudipCache.


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