eZPublishCommunityProject  2013.6
eZ\Publish\Core\MVC\Symfony\Cache\Http\LocationAwareStore Class Reference

LocationAwareStore implements all the logic for storing cache metadata regarding locations. More...

+ Inheritance diagram for eZ\Publish\Core\MVC\Symfony\Cache\Http\LocationAwareStore:
+ Collaboration diagram for eZ\Publish\Core\MVC\Symfony\Cache\Http\LocationAwareStore:

Public Member Functions

 getFilesystem ()
 
 getLocationCacheDir ($locationId=null)
 Returns cache dir for $locationId. More...
 
 getLocationCacheLockName ($locationId=null)
 Returns cache lock name for $locationId. More...
 
 getPath ($key)
 Returns the right path where cache is being stored. More...
 
 purgeAllContent ()
 Purges all cached content. More...
 
 purgeByRequest (Request $request)
 Purges data from $request. More...
 
 setFilesystem (Filesystem $fs)
 Injects a Filesystem instance For unit tests only. More...
 

Public Attributes

const LOCATION_CACHE_DIR = 'ezlocation'
 
const LOCATION_STALE_CACHE_DIR = 'ezlocation_stale'
 

Protected Member Functions

 generateContentDigest (Response $response)
 Injects eZ Publish specific information in the content digest if needed. More...
 

Private Member Functions

 purgeLocation ($locationId)
 Purges cache for $locationId. More...
 

Private Attributes

 $fs
 

Detailed Description

LocationAwareStore implements all the logic for storing cache metadata regarding locations.

Member Function Documentation

eZ\Publish\Core\MVC\Symfony\Cache\Http\LocationAwareStore::generateContentDigest ( Response  $response)
protected

Injects eZ Publish specific information in the content digest if needed.

X-Location-Id response header is set in the ViewController

See Also
::viewLocation()
Parameters
\Symfony\Component\HttpFoundation\Response$response
Returns
string
eZ\Publish\Core\MVC\Symfony\Cache\Http\LocationAwareStore::getFilesystem ( )
eZ\Publish\Core\MVC\Symfony\Cache\Http\LocationAwareStore::getLocationCacheDir (   $locationId = null)

Returns cache dir for $locationId.

This method is public only for unit tests. Use it only if you know what you are doing.

Parameters
int$locationId
Returns
string

Referenced by eZ\Publish\Core\MVC\Symfony\Cache\Http\LocationAwareStore\getPath(), and eZ\Publish\Core\MVC\Symfony\Cache\Http\LocationAwareStore\purgeLocation().

eZ\Publish\Core\MVC\Symfony\Cache\Http\LocationAwareStore::getLocationCacheLockName (   $locationId = null)

Returns cache lock name for $locationId.

This method is public only for unit tests. Use it only if you know what you are doing.

Parameters
int$locationId,.If null, will return a global cache lock name (purging all content)
Returns
string

Referenced by eZ\Publish\Core\MVC\Symfony\Cache\Http\LocationAwareStore\getPath(), and eZ\Publish\Core\MVC\Symfony\Cache\Http\LocationAwareStore\purgeLocation().

eZ\Publish\Core\MVC\Symfony\Cache\Http\LocationAwareStore::getPath (   $key)

Returns the right path where cache is being stored.

Will detect if $key is eZ Publish specific.

Parameters
string$key
Returns
string
eZ\Publish\Core\MVC\Symfony\Cache\Http\LocationAwareStore::purgeAllContent ( )
eZ\Publish\Core\MVC\Symfony\Cache\Http\LocationAwareStore::purgeByRequest ( Request  $request)

Purges data from $request.

If X-Location-Id or X-Group-Location-Id header is present, the store will purge cache for given locationId or group of locationIds. If not, regular purge by URI will occur.

Parameters
\Symfony\Component\HttpFoundation\Request$request
Returns
boolean True if purge was successful. False otherwise

Implements eZ\Publish\Core\MVC\Symfony\Cache\Http\RequestAwarePurger.

eZ\Publish\Core\MVC\Symfony\Cache\Http\LocationAwareStore::purgeLocation (   $locationId)
private

Purges cache for $locationId.

Parameters
int | null$locationId,.If null, all locations will be purged.
Returns
boolean

Referenced by eZ\Publish\Core\MVC\Symfony\Cache\Http\LocationAwareStore\purgeAllContent(), and eZ\Publish\Core\MVC\Symfony\Cache\Http\LocationAwareStore\purgeByRequest().

eZ\Publish\Core\MVC\Symfony\Cache\Http\LocationAwareStore::setFilesystem ( Filesystem  $fs)

Injects a Filesystem instance For unit tests only.

Parameters
\Symfony\Component\Filesystem\Filesystem$fs

Member Data Documentation

const eZ\Publish\Core\MVC\Symfony\Cache\Http\LocationAwareStore::LOCATION_CACHE_DIR = 'ezlocation'
const eZ\Publish\Core\MVC\Symfony\Cache\Http\LocationAwareStore::LOCATION_STALE_CACHE_DIR = 'ezlocation_stale'

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