Stud.IP  5.4
StudipFileCache Class Reference
Inheritance diagram for StudipFileCache:
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()

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

expire (   $arg)

expire cache item

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

Implements StudipCache.

◆ flush()

flush ( )

Expire all items from the cache.

Implements StudipCache.

◆ getCacheDir()

getCacheDir ( )

get path to cache directory

Returns
string

◆ getConfig()

static getConfig ( )
static

Return the Vue component name and props that handle configuration.

Returns
array

Implements StudipCache.

◆ getDisplayName()

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

Implements StudipCache.

◆ getStats()

getStats ( )

Return statistics.

Returns
array|array[]

Implements StudipCache.

◆ purge()

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

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

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: