Skip to content

functions_modules_globalcache

Daniel Spors edited this page Dec 19, 2023 · 3 revisions

Functions in file modules/globalcache.php

globalcache_init

Initializes the globalcache module.

Definition: public function globalcache_init()

Returns: void

globalcache_set

Save a value/object in the global cache.

Definition: public function globalcache_set($key, $value, $ttl=false)

Returns: bool true if ok, false on error

Parameters:

  • string $key the key of the value

  • mixed $value the object/string to save

  • int $ttl time to live (in seconds) of the caching

globalcache_get

Get a value/object from the global cache.

Definition: public function globalcache_get($key, $default=false)

Returns: mixed The object from the cache or $default

Parameters:

  • string $key the key of the value

  • mixed $default a default return value if the key can not be found in the cache

globalcache_clear

Empty the whole cache.

Definition: public function globalcache_clear($expired_only=false)

Returns: bool true if ok, false on error

Parameters:

  • bool $expired_only If true, only expired entries will be deleted

globalcache_delete

Delete a value from the global cache.

Definition: public function globalcache_delete($key)

Returns: bool true if ok, false on error

Parameters:

  • string $key the key of the value

globalcache_info

Returns information about the cache usage. Note: this currently returns various different information and format thus needs to be streamlined.

Definition: public function globalcache_info()

Returns: mixed Cache information

globalcache_list_keys

Gets a list of all keys in the cache.

Definition: public function globalcache_list_keys()

Returns: array list of all keys

Clone this wiki locally