void cachePermissions(
mixed
$ids, string
$permission
)
|
|
Store the given permission => ids mapping in the session cache
Parameters:
mixed |
$ids: |
item ids (can be an array of ids or a single id) |
string |
$permission: |
|
void clearPermissionCache(
)
|
|
Clear permission cache for active user.
boolean containsKey(
string
$key
)
|
|
Does the cache contain the key specified?
Parameters:
API Tags:
Return: | true if the cache contains the key given |
Retrieve data from the cache
Parameters:
API Tags:
Return all the keys in the cache
API Tags:
string getCachePath(
$pathInfo
)
|
|
Given a path info descriptor, return the path to the appropriate cache file.
Path info contains the following variables: type: entity, derivative, derivative-relative, fast-download, module, module-data, theme, local-url-map itemId: the item id id: (module, theme only) a refinement of the type
Parameters:
API Tags:
array getCacheTuple(
int
$id
)
|
|
For a given id, return a tuple with the breakdown of the id. The caching mechanism uses this to determine where in the cache tree to place the file. The breakdown happens according to the digits of the id. The first element returned is the hundreds digit, the second element is the tens digit.
0..9 => 0, 0 10..19 => 0, 1 20..29 => 0, 2 ... 100..109 => 1, 0 110..119 => 1, 1
Parameters:
API Tags:
mixed &getFromDisk(
array
$pathInfo
)
|
|
Get the file from disk. PathInfo is of the form that can be passed to getCachePath
Parameters:
array |
$pathInfo: |
the path info |
API Tags:
Return: | object data |
See: | GalleryDataCache::getCachePath |
array getPageData(
string
$type, mixed
$keyData
)
|
|
Get page data from the cache.
Parameters:
string |
$type: |
the page type |
mixed |
$keyData: |
data to use to generate the unique key for this cache entry |
API Tags:
Return: | GalleryStatus a status code string the page data |
boolean hasPermission(
int
$id, string
$permission
)
|
|
Look up the given permission in the cache. Return true if the permission exists in the cache, false if it doesn't. A return of false doesn't mean that the user doesn't have the permission -- just that it's not in the cache.
Parameters:
int |
$id: |
the item id |
string |
$permission: |
|
boolean &isFileCachingEnabled(
)
|
|
Is caching to disk enabled?
boolean isMemoryCachingEnabled(
)
|
|
Is in-memory caching enabled?
API Tags:
Return: | true if it's enabled |
void put(
string
$key, mixed
$data, [boolean
$protected = false]
)
|
|
Store data in the cache You must provide a unique key. Existing keys are overwritten.
Parameters:
string |
$key: |
|
mixed |
$data: |
|
boolean |
$protected: |
should this key survive a reset call? |
void putByReference(
string
$key,
&$data, [boolean
$protected = false], mixed
$data
)
|
|
Store a reference to the data in the cache
You must provide a unique key. Existing keys are overwritten.
Parameters:
string |
$key: |
|
mixed |
$data: |
|
boolean |
$protected: |
(optional) should this key survive a reset call? |
|
&$data: |
|
GalleryStatus putPageData(
string
$type, int
$itemId, mixed
$keyData, string
$value
)
|
|
Store page data from the cache.
Parameters:
string |
$type: |
the page type |
int |
$itemId: |
the itemId of the item this page is rendering |
mixed |
$keyData: |
data to use to generate the unique key for this cache entry |
string |
$value: |
the page data |
API Tags:
void putToDisk(
array
$pathInfo,
&$data, [array
$requiredClasses = array()], mixed
$data
)
|
|
Put the specified data into a cache file from disk. PathInfo is of the form that can be passed to getCachePath.
Parameters:
array |
$pathInfo: |
the path info |
mixed |
$data: |
the object data |
array |
$requiredClasses: |
classes that must be loaded in order to retrieve this data |
|
&$data: |
|
API Tags:
See: | GalleryDataCache::getCachePath |
void remove(
string
$key
)
|
|
Remove data from the cache
Parameters:
void removeByPattern(
string
$pattern
)
|
|
Remove data from the cache
Parameters:
void removeFromDisk(
array
$pathInfo
)
|
|
Remove the cache file from disk. PathInfo is of the form that can be passed to getCachePath
Parameters:
array |
$pathInfo: |
the path info |
API Tags:
See: | GalleryDataCache::getCachePath |
Remove all cached page data for the given item ids
Parameters:
mixed |
$itemIds: |
one item id, or an array of item ids |
API Tags:
void reset(
[boolean
$purgeProtected = false]
)
|
|
Empty the cache of all but protected entries
Parameters:
boolean |
$purgeProtected: |
(optional) purge protected also? |
void setFileCachingEnabled(
boolean
$bool
)
|
|
Turn caching to disk on or off
Parameters:
void setMemoryCachingEnabled(
boolean
$bool
)
|
|
Turn in-memory caching on or off
Parameters:
Should we use the cache for this page or not? Right now we cache a page if it's a GET request, the browser hasn't specified that it wants uncached data, and the caching policy for the given user class is appropriate.
Parameters:
string |
$action: |
|
string |
$type: |
the page type |
API Tags:
Delete value of obsolete cache data.
API Tags:
Get the static cache
API Tags:
Return: | the cache |
Staticvar: | cache $cache: the singleton cache |
Access: | private |
array _getExtraPageCacheKey(
)
|
|
Returns session related page cache key, eg. to make the page cache language sensitive
API Tags:
Return: | GalleryStatus a status code string extra cache key |
Information Tags:
Todo: | The extra key for exif module is a quick fix, not a permanent fix; it should be cached on the block level not on page level. |
void _performMaintenance(
)
|
|
Perform some pruning of our cache to prevent it from growing too large when we're doing exceptionally long operations like adding many items in one request.
API Tags: