Class

CacheManager

Package: io Author: Benoit Sautel <ben.popeye@phpboost.com> Desc: This class manages cache. It makes a two-level lazy loading:
  • A top-level cache which avoids loading a data if it has already been done since the beginning of the current page generation. This cache has a short life span: it's flushed as of the PHP interpreter reaches the end of the page generation.
  • A filesystem or shared RAM (via APC) cache to avoid querying the database every time to obtain the same value. This cache is less powerful than the previous but has an infinite life span. Indeed, it's valid until the value changes and the manager is asked to store it
Located at io/data/cache/CacheManager.class.php
Methods summary
public static CacheData
# load( string $classname, string $module_name, string $entry_name = '' )

Loads the data which is identified by the parameters

public static CacheData
# try_load( string $classname, string $module_name, string $entry_name )

Tries to load the data which is identified by the parameters

public static
# invalidate( string $module_name, string $entry_name = '' )

Invalidates an entry which is cached. If the corresponding data are loaded agin, they will be regenerated.

public static
# clear( )

Invalidates all the cached data

public static
# save( mixed $data, string $module_name, string $entry_name = '' )

Caches the data corresponding to the given identifier