|
eZ Publish
[trunk]
|
Inheritance diagram for eZStaticCache:
Collaboration diagram for eZStaticCache:Public Member Functions | |
| __construct () | |
| Initialises the static cache object with settings from staticcache.ini. | |
| alwaysUpdateURLArray () | |
| Getter method for eZStaticCache::$alwaysUpdate. | |
| cachedSiteAccesses () | |
| Getter method for eZStaticCache::$cachedSiteAccesses. | |
| cachedURLArray () | |
| Getter method for eZStaticCache::$cachedURLArray. | |
| cacheURL ($url, $nodeID=false, $skipExisting=false, $delay=true) | |
| Generates the caches for the url $url using the currently configured storageDirectory(). | |
| generateAlwaysUpdatedCache ($quiet=false, $cli=false, $delay=true) | |
| Generates the caches for all URLs that must always be generated. | |
| generateCache ($force=false, $quiet=false, $cli=false, $delay=true) | |
| Generates the static cache from the configured INI settings. | |
| generateNodeListCache ($nodeList) | |
| Generates caches for all the urls of nodes in $nodeList. | |
| hostName () | |
| Getter method for eZStaticCache::$hostName. | |
| maxCacheDepth () | |
| Getter method for eZStaticCache::$maxCacheDepth. | |
| removeURL ($url) | |
| Removes the static cache file (index.html) and its directory if it exists. | |
| storageDirectory () | |
| Getter method for eZStaticCache::$staticStorageDir. | |
Static Public Member Functions | |
| static | executeActions () |
| This function goes over the list of recorded actions and excecutes them. | |
| static | storeCachedFile ($file, $content) |
| Stores the cache file $file with contents $content. | |
Public Attributes | |
| const | USER_AGENT = 'eZ Publish static cache generator' |
| User-Agent string. | |
Private Member Functions | |
| addAction ($action, $parameters) | |
| This function adds an action to the list that is used at the end of the request to remove and regenerate static cache files. | |
| buildCacheDirPart ($dir, $siteAccess) | |
| A helper method used to create directory parts array. | |
| buildCacheDirPath ($siteAccess) | |
| Generates a cache directory parts including path, siteaccess name, site URL depending on the match order type. | |
| buildCacheFilename ($staticStorageDir, $url) | |
| Generates a full path to the cache file (index.html) based on the input parameters. | |
| storeCache ($url, $staticStorageDir, $alternativeStaticLocations=array(), $skipUnlink=false, $delay=true) | |
| Stores the static cache for $url and hostname defined in site.ini. | |
Private Attributes | |
| $alwaysUpdate | |
| $cachedSiteAccesses = array() | |
| $cachedURLArray = array() | |
| $hostName | |
| $maxCacheDepth | |
| $staticStorage | |
Static Private Attributes | |
| static | $actionList = array() |
Definition at line 29 of file ezstaticcache.php.
Initialises the static cache object with settings from staticcache.ini.
Definition at line 84 of file ezstaticcache.php.
| eZStaticCache::addAction | ( | $ | action, |
| $ | parameters | ||
| ) | [private] |
This function adds an action to the list that is used at the end of the request to remove and regenerate static cache files.
| string | $action | |
| array | $parameters |
Definition at line 568 of file ezstaticcache.php.
Referenced by storeCache().
Getter method for eZStaticCache::$alwaysUpdate.
These URLs are configured with AlwaysUpdateArray in staticcache.ini.
Definition at line 154 of file ezstaticcache.php.
| eZStaticCache::buildCacheDirPart | ( | $ | dir, |
| $ | siteAccess | ||
| ) | [private] |
A helper method used to create directory parts array.
| string | $dir | |
| string | $siteAccess |
Definition at line 501 of file ezstaticcache.php.
Referenced by buildCacheDirPath().
| eZStaticCache::buildCacheDirPath | ( | $ | siteAccess | ) | [private] |
Generates a cache directory parts including path, siteaccess name, site URL depending on the match order type.
| string | $siteAccess |
Definition at line 450 of file ezstaticcache.php.
Referenced by storeCache().
| eZStaticCache::buildCacheFilename | ( | $ | staticStorageDir, |
| $ | url | ||
| ) | [private] |
Generates a full path to the cache file (index.html) based on the input parameters.
| string | $staticStorageDir | The storage for cache files. |
| string | $url | The URL for the current item, e.g /news |
Definition at line 436 of file ezstaticcache.php.
Referenced by storeCache().
Getter method for eZStaticCache::$cachedSiteAccesses.
Definition at line 131 of file ezstaticcache.php.
Referenced by __construct(), and storeCache().
Getter method for eZStaticCache::$cachedURLArray.
Definition at line 141 of file ezstaticcache.php.
Referenced by __construct(), cacheURL(), and generateCache().
| eZStaticCache::cacheURL | ( | $ | url, |
| $ | nodeID = false, |
||
| $ | skipExisting = false, |
||
| $ | delay = true |
||
| ) |
Generates the caches for the url $url using the currently configured storageDirectory().
| string | $url | The URL to cache, e.g /news |
| int | false | $nodeID | The ID of the node to cache, if supplied it will also cache content/view/full/xxx. |
| bool | $skipExisting | If true it will not unlink existing cache files. |
Implements ezpStaticCache.
Definition at line 317 of file ezstaticcache.php.
Referenced by generateCache(), and generateNodeListCache().
| static eZStaticCache::executeActions | ( | ) | [static] |
This function goes over the list of recorded actions and excecutes them.
Implements ezpStaticCache.
Definition at line 576 of file ezstaticcache.php.
| eZStaticCache::generateAlwaysUpdatedCache | ( | $ | quiet = false, |
| $ | cli = false, |
||
| $ | delay = true |
||
| ) |
Generates the caches for all URLs that must always be generated.
| bool | $quiet | If true then the function will not output anything. |
| eZCLI | false | $cli | The eZCLI object or false if no output can be done. |
| bool | $delay |
Implements ezpStaticCache.
Definition at line 166 of file ezstaticcache.php.
| eZStaticCache::generateCache | ( | $ | force = false, |
| $ | quiet = false, |
||
| $ | cli = false, |
||
| $ | delay = true |
||
| ) |
Generates the static cache from the configured INI settings.
| bool | $force | If true then it will create all static caches even if it is not outdated. |
| bool | $quiet | If true then the function will not output anything. |
| eZCLI | false | $cli | The eZCLI object or false if no output can be done. |
| bool | $delay |
Implements ezpStaticCache.
Definition at line 227 of file ezstaticcache.php.
| eZStaticCache::generateNodeListCache | ( | $ | nodeList | ) |
Generates caches for all the urls of nodes in $nodeList.
The associative array must have on of these entries:
| array | $nodeList | An array with node entries, each entry is either the node ID or an associative array. |
Implements ezpStaticCache.
Definition at line 187 of file ezstaticcache.php.
Getter method for eZStaticCache::$hostName.
Definition at line 101 of file ezstaticcache.php.
Referenced by __construct(), and storeCache().
Getter method for eZStaticCache::$maxCacheDepth.
Definition at line 121 of file ezstaticcache.php.
Referenced by __construct(), and cacheURL().
| eZStaticCache::removeURL | ( | $ | url | ) |
Removes the static cache file (index.html) and its directory if it exists.
The directory path is based upon the URL $url and the configured static storage dir.
| string | $url | The URL for the current item, e.g /news |
Implements ezpStaticCache.
Definition at line 553 of file ezstaticcache.php.
Getter method for eZStaticCache::$staticStorageDir.
Definition at line 111 of file ezstaticcache.php.
| eZStaticCache::storeCache | ( | $ | url, |
| $ | staticStorageDir, | ||
| $ | alternativeStaticLocations = array(), |
||
| $ | skipUnlink = false, |
||
| $ | delay = true |
||
| ) | [private] |
Stores the static cache for $url and hostname defined in site.ini.
[SiteSettings].SiteURL for cached siteaccess by fetching the web page using eZHTTPTool::getDataByURL() and storing the fetched HTML data.
| string | $url | The URL to cache, e.g /news |
| string | $staticStorageDir | The base directory for storing cache files. |
| array | $alternativeStaticLocations | |
| bool | $skipUnlink | If true it will not unlink existing cache files. |
| bool | $delay |
Definition at line 361 of file ezstaticcache.php.
Referenced by cacheURL(), and generateAlwaysUpdatedCache().
| static eZStaticCache::storeCachedFile | ( | $ | file, |
| $ | content | ||
| ) | [static] |
Stores the cache file $file with contents $content.
Takes care of setting proper permissions on the new file.
| string | $file | |
| string | $content |
Definition at line 515 of file ezstaticcache.php.
Referenced by storeCache().
eZStaticCache::$actionList = array() [static, private] |
Definition at line 36 of file ezstaticcache.php.
eZStaticCache::$alwaysUpdate [private] |
Definition at line 79 of file ezstaticcache.php.
eZStaticCache::$cachedSiteAccesses = array() [private] |
Definition at line 72 of file ezstaticcache.php.
eZStaticCache::$cachedURLArray = array() [private] |
Definition at line 65 of file ezstaticcache.php.
eZStaticCache::$hostName [private] |
Definition at line 44 of file ezstaticcache.php.
eZStaticCache::$maxCacheDepth [private] |
Definition at line 58 of file ezstaticcache.php.
eZStaticCache::$staticStorage [private] |
Definition at line 51 of file ezstaticcache.php.
| const eZStaticCache::USER_AGENT = 'eZ Publish static cache generator' |