KWeb  6.4
KWebCache Class Reference

Public Member Functions

 __destruct ()
 installGenre ($genre)
 getObject ($genre, $id, $critical=true, $param=false)
 objectExists ($genre, $id, $params=false)
 checkObjectId ($genre, $id)
 getObjects ($genre, $ids, $param=false)
 isNameOccupied ($name, $lang=false)
 Returns TRUE if pathname is already taken.
 getItem ($id, $critical=true, $lang=false)
 getLink ($id, $critical=true)
 itemExists ($id, $lang=false)
 checkItemId ($id)
 checkLinkId ($id)
 getItems ($ids, $lang=false)
 getLinks ($ids)
 Zwraca linki o identyfikatorach z listy.
 storeUpdates ()
 All updates will be commited to the database at the end of the script (in commitUpdates)
 sqlUpdateItems ()
 commitUpdates ($force=false)
 findCachedObject ($genre, $id)
 Obsługa elementów.
 getCachedObjects ($genre, $ids, $params)
 Loads objects with provided ids, from provided genre.
 storeCacheObject ($genre, $obj, $idHint=null)
 Stores the object in the INTERNAL cache.
 getCacheObject ($genre, $id)
 releaseObjects ($genre, array $ids=null)
 Calls releaseObject() on all objects, that are currently held by cache...
 unsetCacheObject ($genre, $id)
 Removes the object from the INTERNAL cache.
 unsetAllCacheObjects ($genre=false)
 Purge internal cache.
 makeCachedFilename ($genre, $id)
 Obsługa linków.
 prepareAccessCache ($recreate=false)
 prepareNamesCache ($lang=false, $recreate=false)
 storeCache ()
 resetDataCache ()
 resetObjectsCache ($genre=false)
 resetWholeCache ()

Static Public Member Functions

static instance ($create=true)

Data Fields

 $masterSwitch
 $access
 $names = array()
 Cache nazw ( lang => array(name => id) , ...)
 $items
 Cache elementów jako item_id=>obiekt.
 $drafts = array()
 $users = array()
 $links
 Cache linków jako link_id=>obiekt.
 $objects = array()
 Cache obiektów segregowany przez GENRE typów.
 $resetData = false
 $resetObjects = false
 $cachePath
 $cacheType
 $cacheDirPrefix = 'obj_'
 $block = array()

Static Public Attributes

static $inst = null

Protected Member Functions

 __construct ()
 _initialize ()

Protected Attributes

 $hasUpdates = false

Constructor & Destructor Documentation

KWebCache::__construct ( ) [protected]
KWebCache::__destruct ( )

Member Function Documentation

KWebCache::_initialize ( ) [protected]
KWebCache::checkItemId ( id)
KWebCache::checkLinkId ( id)
KWebCache::checkObjectId ( genre,
id 
)
KWebCache::commitUpdates ( force = false)
KWebCache::findCachedObject ( genre,
id 
)

Obsługa elementów.

KWebCache::getCachedObjects ( genre,
ids,
params 
)

Loads objects with provided ids, from provided genre.

Object are loaded in this manner:

  • identifier is resolved with GENRE_CLASS::resolveObjectName
  • if object is available in internal cache, then use it
  • if object is stored on disk, and it's valid, rebuild it and use it
  • for the rest of the objects, they're fetched from the original source through GENRE_CLASS::fetchObjects
  • before returning, objects are ordered in the same order they were asked for
KWebCache::getCacheObject ( genre,
id 
)
KWebCache::getItem ( id,
critical = true,
lang = false 
)
Returns:
KWebItem
KWebCache::getItems ( ids,
lang = false 
)
KWebCache::getLink ( id,
critical = true 
)
Returns:
KWebLink
KWebCache::getLinks ( ids)

Zwraca linki o identyfikatorach z listy.

KWebCache::getObject ( genre,
id,
critical = true,
param = false 
)
Parameters:
$genreIf genre is false, $id is treated as UID
Returns:
KWebObject
KWebCache::getObjects ( genre,
ids,
param = false 
)
KWebCache::installGenre ( genre)
static KWebCache::instance ( create = true) [static]
Returns:
KWebCache
KWebCache::isNameOccupied ( name,
lang = false 
)

Returns TRUE if pathname is already taken.

KWebCache::itemExists ( id,
lang = false 
)
KWebCache::makeCachedFilename ( genre,
id 
)

Obsługa linków.

KWebCache::objectExists ( genre,
id,
params = false 
)
KWebCache::prepareAccessCache ( recreate = false)
KWebCache::prepareNamesCache ( lang = false,
recreate = false 
)

isset($this->names[$lang]) ||

KWebCache::releaseObjects ( genre,
array $  ids = null 
)

Calls releaseObject() on all objects, that are currently held by cache...

KWebCache::resetDataCache ( )
KWebCache::resetObjectsCache ( genre = false)
KWebCache::resetWholeCache ( )
KWebCache::sqlUpdateItems ( )
KWebCache::storeCache ( )
KWebCache::storeCacheObject ( genre,
obj,
idHint = null 
)

Stores the object in the INTERNAL cache.

This cache is valid only for the current request.

When new object is instantiated (by creating new one, ore reading from the database) it has to be stored in the internal cache, so that subsequent requests for the same object can use this instance.

If the object is read from the disk cache, it's put into internal cache automatically.

Additionaly, in case of ID change (from temporary to DB id, or ID switch) object should be registered under the new ID, but the old reference should be kept intact. This way the object can be referenced by both IDs easily.

To store the object permanently on disk, use KWebObject::updateCache

Parameters:
$idHintID of the object to use. If false, KWebObject::getObjectId() will be used
KWebCache::storeUpdates ( )

All updates will be commited to the database at the end of the script (in commitUpdates)

KWebCache::unsetAllCacheObjects ( genre = false)

Purge internal cache.

KWebCache::unsetCacheObject ( genre,
id 
)

Removes the object from the INTERNAL cache.

This cache is valid only for the current request.


Field Documentation

KWebCache::$access
KWebCache::$block = array()
KWebCache::$cacheDirPrefix = 'obj_'
KWebCache::$cachePath
KWebCache::$cacheType
KWebCache::$drafts = array()
KWebCache::$hasUpdates = false [protected]
KWebCache::$inst = null [static]
KWebCache::$items

Cache elementów jako item_id=>obiekt.

KWebCache::$links

Cache linków jako link_id=>obiekt.

KWebCache::$masterSwitch
KWebCache::$names = array()

Cache nazw ( lang => array(name => id) , ...)

KWebCache::$objects = array()

Cache obiektów segregowany przez GENRE typów.

KWebCache::$resetData = false
KWebCache::$resetObjects = false
KWebCache::$users = array()

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