Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
Cache_Manager Class Reference
Inheritance diagram for Cache_Manager:
Asset MySource_Object

Public Member Functions

 __construct ($assetid=0)
 
 __wakeup ()
 
 create (&$link)
 
 _getName ($short_name=FALSE)
 
 canDelete ()
 
 canClone ()
 
 loadFromCache ($assetid, $asset_type, $cache_key='', $use_url=TRUE)
 
 saveToCache ($assetid, $asset_type, $cache_key, $contents, $use_url=TRUE, $expiry_override='')
 
 _formUniqueUrl ($url)
 
 clearCache ($assetids)
 
 getFilePaths ($assetids)
 
 canClearByAssetid ()
 
 clearAllCache ()
 
 getAllFilePaths ($option='')
 
 _getPermKey ($assetid, $cache_key)
 
 getAssetHash ($assetid=0)
 
 cacheEnabled ($type_code='', $assetid='')
 
 sendCacheableHeaders ($type_code='', $assetid='')
 
 getExpiry ($type_code='', $assetid='')
 
 getBrowserCacheExpiry ($type_code='', $assetid='')
 
 _specificCacheManagementSettings ($type_code, $assetid, $value)
 
 getCacheStorage ()
 
 clearCachedAssetsByUrl ($url)
 
 setAttrValue ($name, $value)
 
 cacheableHeadersEnabledForCurrentProtocol ()
 
 cacheControlLevel ()
 
- Public Member Functions inherited from Asset
 Asset ($assetid=0)
 
 create (Array &$link)
 
 load ($assetid)
 
 _loadDataPaths ()
 
 reload ()
 
 canDelete ()
 
 delete ($release_lock=TRUE, $check_locked=TRUE)
 
 useSystemVersion ()
 
 loadSystemVersion ()
 
 saveSystemVersion ()
 
 clearSystemVersion ()
 
 revertToSystemVersion ()
 
 revertNoticeLinksToSystemVersion ()
 
 _updated ($update_parents=TRUE)
 
 type ()
 
 getTypeAncestors ($include_asset=TRUE)
 
 incrementVersion ($number='micro', $update_parents=TRUE)
 
 getLanguages ()
 
 setLanguages (Array $languages)
 
 setCharset ($charset)
 
 setForceSecure ($force_secure)
 
 remapAssetids (Array $map)
 
 morph ($new_type_code)
 
 _morphCleanup ($new_type_code)
 
 onRequestKeywords (Asset $broadcaster, Array $vars=Array())
 
 canClone ()
 
 cloneComponents (Asset $clone, Array $components, $override=FALSE)
 
 cloneComponentsAdditional (Asset $clone, Array $components)
 
 cloneLinks (Asset $clone)
 
 getStatus ()
 
 getAvailableStatii ()
 
 getStatusDescription ()
 
 processStatusChange ($new_status, $update_parents=TRUE, $run_updated=TRUE)
 
 setDate ($date_type, $time=NULL, $userid=NULL)
 
 lockTypes ()
 
 canForceablyAcquireLock ($lock_type)
 
 getEditingLocks ($keywords)
 
 _getAllowedLinks ()
 
 createLink (Asset $minor, $link_type, $value='', $sort_order=NULL, $dependant='0', $exclusive='0', $moving=FALSE, $locked=0)
 
 prepareLink (Asset $asset, $side_of_link, &$link_type, &$value, &$sort_order, &$dependant, &$exclusive)
 
 canCreateLink (Asset $minor, $link_type, $exclusive)
 
 canMoveLink (Asset $minor, Asset $old_major, $link_type)
 
 describeLink ($linkid)
 
 isDeletableLink ($linkid)
 
 canDeleteLink ($linkid)
 
 deleteLink ($linkid, $check_locked=TRUE)
 
 linksUpdated ()
 
 canCloneLink ()
 
 saveAttributes ($dont_run_updated=FALSE, $log_message=TRUE)
 
 setAttrValue ($name, $value)
 
 attr ($name)
 
attrByRef ($name)
 
 getAttribute ($name, $mute_errors=FALSE)
 
 getAssetKeywords ($descriptions=FALSE)
 
 getAvailableKeywords ()
 
 getKeywordReplacement ($keyword)
 
 getAssetWebPathKeywordReplacement ()
 
 getCustomKeywordReplacements ($keywords=Array(), $invoke_backend=FALSE)
 
 processCustomKeywords ($keywords=Array())
 
 getContent ()
 
 setContent ()
 
 getEffectiveLastUpdatedTime ($assetids)
 
 readAccess (Array $assetids=Array())
 
 writeAccess ($lock_type='', Array $assetids=Array(), $only_workflow=TRUE)
 
 adminAccess ($lock_type='', Array $assetids=Array())
 
 backendAccess ()
 
 liveEditAccess ($lock_type)
 
 canliveEdit ($lock_type)
 
 effectiveUnrestricted ()
 
 checkAccess ($perm, $lock_type, Array $assetids=Array(), $only_workflow=TRUE)
 
 accessEffective ()
 
 permissionsUpdated ()
 
 printFrontend ()
 
 printFrontendAsset (Asset $asset, $design=NULL)
 
 getValidProtocols ()
 
 printHead ()
 
 printBody ()
 
 getCurrentPaintLayoutName ()
 
 getCurrentDesignName ()
 
 printBodyWithPaintLayout ($layout_id='')
 
 initLimbo ()
 
 printLimbo ()
 
 paintBackend (Backend_Outputter $o)
 
 getPrefix ()
 
 processBackend (Backend_Outputter $o, Array &$link)
 
 getEI ()
 
 getEditFns ()
 
 getBackendHref ($screen='', $backend_page=TRUE)
 
 getURL ($base_url=NULL, $ignore_rollback=FALSE, $base_contextid=NULL)
 
 getURLs ()
 
 getHref ($base_url=NULL, $ignore_rollback=FALSE)
 
 getWebDataPath ()
 
 getWebPaths ()
 
 saveWebPaths ($paths, $auto_add_remaps=TRUE)
 
 getLookups ($field='')
 
 getDesignLookups ()
 
 getLookupValues ($inherited=NULL, $prefix='', $like_search=TRUE, $ignore_override=FALSE)
 
 deleteLookupValue ($layout_name, $layout_value)
 
 setPaintLayouts ($layouts)
 
 updateLookups ($auto_add_remaps=TRUE)
 
 setLookupValues (Array $values)
 
 getAssetStatusDescriptionKeywordReplacement ()
 
 getAssetStatusColourKeywordReplacement ()
 
 replaceKeywordsInString ($string)
 
 fastTrack ($tasks)
 
 unFastTrack ($tasks)
 
 shouldFastTrack ($task, $assetid=NULL)
 
 getFaskTrackedTaskAssetids ($task)
 
 getDependantParentsURL ()
 
- Public Member Functions inherited from MySource_Object
 MySource_Object ()
 
 __sleep ()
 
 __wakeup ()
 

Data Fields

 $global_cache = FALSE
 
- Data Fields inherited from Asset
 $id = 0
 
 $version = ''
 
 $name = ''
 
 $short_name = ''
 
 $status
 
 $languages = ''
 
 $charset = ''
 
 $force_secure = '0'
 
 $created
 
 $created_userid
 
 $updated
 
 $updated_userid
 
 $published
 
 $published_userid
 
 $status_changed
 
 $status_changed_userid
 
 $_is_cacheable = FALSE
 
 $vars = Array()
 
 $_available_keywords = Array()
 
 $data_path_suffix = ''
 
 $data_path = ''
 
 $data_path_public = ''
 
 $_ser_attrs = FALSE
 
- Data Fields inherited from MySource_Object
 $_tmp
 

Protected Member Functions

 _loadCacheStorage ($storage_type)
 
- Protected Member Functions inherited from Asset
 _preCreateCheck (Array &$link)
 
 _createAdditional (Array &$link)
 
 _abortCreate ($trigger_level_changed=FALSE, $linkid=0)
 
 _loadVars ()
 
 _getName ($short_name=FALSE, $contextid=NULL)
 
 _getKeywordReplacement ($keyword)
 
 _checkPermissionAccess ($perm, $assetids=Array(), $only_workflow=TRUE)
 
 makeAndSaveInitialWebPath ($path, $parent_link=NULL)
 

Protected Attributes

 $_storage
 

Detailed Description

Definition at line 31 of file cache_manager.inc.

Constructor & Destructor Documentation

__construct (   $assetid = 0)

Constructor

Parameters
int$assetidthe asset id to be loaded

Definition at line 56 of file cache_manager.inc.

Member Function Documentation

__wakeup ( )

Wakeup.

public

Definition at line 72 of file cache_manager.inc.

_formUniqueUrl (   $url)

Saves the specified contents to the cache, which will be identified by the specfied asset and key/url

If cache entry already exists, it will be overwritten with the new contents and expiry time

Parameters
string$urlid of the the asset that owns the cache file
Returns
boolean public

Definition at line 268 of file cache_manager.inc.

_getName (   $short_name = FALSE)

Returns name of the asset

Parameters
boolean$short_namewhether or not we are after the shortname or the full name
Returns
string private

Definition at line 124 of file cache_manager.inc.

_getPermKey (   $assetid,
  $cache_key 
)

Return the key suffix that represents a cached object based on cache levels

Takes logged in status, permissions and user groups in account Also takes the type of asset being cached into account (standard or listing based)

Parameters
string$assetidthe id of asset that identifies this cache entry
string$cache_keythe cache key passed by the asset being cached
Returns
string private

Definition at line 397 of file cache_manager.inc.

_loadCacheStorage (   $storage_type)
protected

Load the cache storage asset for the specified storage type

Parameters
string$storage_typeThe type of storage requested
Returns
void

Definition at line 726 of file cache_manager.inc.

_specificCacheManagementSettings (   $type_code,
  $assetid,
  $value 
)

Returns specified setting for the provided type code or assetid

Type code specific settings take priority over root node configured settings

Parameters
string$type_codethe type code of the wanted value
string$assetidthe assetid of the wanted value
string$valuethe value required
Returns
mixed int|boolean private

Definition at line 660 of file cache_manager.inc.

cacheableHeadersEnabledForCurrentProtocol ( )

Returns TRUE if cache manager is configured to send cacheable headers over current protocol

Returns
booleab public

Definition at line 802 of file cache_manager.inc.

cacheControlLevel ( )

Returns cache control level (public/private) based on current protocol and cache manager settings

Returns
string public

Definition at line 821 of file cache_manager.inc.

cacheEnabled (   $type_code = '',
  $assetid = '' 
)

Check if caching is enabled, generally, for the current root URL and for the specfied type code or assetid

If no type code or assetid is specified this function will return the system wide setting

Parameters
string$type_codethe type_code to check to see if caching is enabled
string$assetidthe assetid to check to see if caching is enabled
Returns
boolean public

Definition at line 505 of file cache_manager.inc.

canClearByAssetid ( )

Can the set cache storage method clear itself when filtered by asset ID?

Returns NULL when there is no storage mechanism yet stored. Otherwise TRUE or FALSE based on the advice provided by the storage method class.

Returns
boolean

Definition at line 346 of file cache_manager.inc.

canClone ( )

Return FALSE always because we don't want to be able to clone a cache manager

Returns
boolean public

Definition at line 150 of file cache_manager.inc.

canDelete ( )

Can this asset have its last significant link removed (putting it in the trash)?

Returns
boolean public

Definition at line 137 of file cache_manager.inc.

clearAllCache ( )

Removes all cache

Returns
void public

Definition at line 363 of file cache_manager.inc.

clearCache (   $assetids)

Removes all cache entries related to this assetid

Parameters
array$assetidsid of the the asset that owns the cache file
Returns
void public

Definition at line 305 of file cache_manager.inc.

clearCachedAssetsByUrl (   $url)

Deletes caches of assets that were cached when a certain URL was requested

This includes caches of nested content that were generated by reaching the passed URL, not just the top-level asset.

The actual ability or not to do this is determined by the relevant cache storage method. Being able to efficiently search by URL would be a pre-requisite.

Parameters
string$urlThe url to delete cache entries for

public

Definition at line 761 of file cache_manager.inc.

create ( $link)

Create this asset

Parameters
array&$linkinformation used to create the initial link
Returns
mixed int|boolean public
See Also
Asset::create()

Definition at line 89 of file cache_manager.inc.

getAllFilePaths (   $option = '')

Returns an array of all file paths for clear cache HIPO job

Parameters
string$optionthe option of the result
Returns
array public

Definition at line 378 of file cache_manager.inc.

getAssetHash (   $assetid = 0)

Return the hash of and asset between 0 and num_cache_dirs

Parameters
string$assetidthe assetid to create the hash from
Returns
string public

Definition at line 470 of file cache_manager.inc.

getBrowserCacheExpiry (   $type_code = '',
  $assetid = '' 
)

Returns the browser cache expiry time for the specified type code or assetid

If the expiry value for provided type code or assetid has not been customised, then the system wide browser cache expiry is returned

Parameters
string$type_codethe type code of the requested browser cache expiry value
string$assetidthe assetid of the requested browser cache expiry value
Returns
int public

Definition at line 636 of file cache_manager.inc.

getCacheStorage ( )

Get the cache storage object

Returns
Cache_Storage

Definition at line 712 of file cache_manager.inc.

getExpiry (   $type_code = '',
  $assetid = '' 
)

Returns the expiry time for the specified type code or assetid

If the expiry value for the provided type code or assetid has not been customised, then the system wide expiry is returned

Parameters
string$type_codethe type code of the wanted expiry value
string$assetidthe assetid of the wanted expiry value
Returns
int public

Definition at line 612 of file cache_manager.inc.

getFilePaths (   $assetids)

Returns an array of file paths for clear cache HIPO job

Parameters
array$assetidsid of the the asset that owns the cache file
Returns
array public

Definition at line 331 of file cache_manager.inc.

loadFromCache (   $assetid,
  $asset_type,
  $cache_key = '',
  $use_url = TRUE 
)

Loads the contents from a cache file for the specified asset and unique key

A return of boolean FALSE should be interpreted as a cache MISS. This can happen if:

  • the cache is disabled (either globally or for that asset type), or
  • the cache file does not exist on the file system, or is not readable, or
  • the cache file exists, but has expired.

A return of '' (empty string) should be interpreted as a cache HIT where the cached result is actually an empty string. Therefore, when checking for a cache MISS, you should directly compare to FALSE using "===".

Parameters
string$assetidid of the the asset that owns the cache file
string$asset_typetype_code of that asset
string$cache_keythe cache key for this entry
boolean$use_urlwhether to use the current url
Returns
mixed string|boolean public

Definition at line 179 of file cache_manager.inc.

saveToCache (   $assetid,
  $asset_type,
  $cache_key,
  $contents,
  $use_url = TRUE,
  $expiry_override = '' 
)

Saves the specified contents to the cache, which will be identified by the specfied asset and key/url

If cache entry already exists, it will be overwritten with the new contents and expiry time

Parameters
string$assetidid of the the asset that owns the cache file
string$asset_typetype_code of that asset
string$cache_keythe cache key for this entry
string$contentsthe contents to save to cache
boolean$use_urlwhether to use the current url
int$expiry_overrideoverride expiry length in seconds
Returns
boolean public

Definition at line 227 of file cache_manager.inc.

sendCacheableHeaders (   $type_code = '',
  $assetid = '' 
)

Returns TRUE if cachaeable headers needs to be send (regardless of other Matrix cache settings) This function doesn't actually sends the headers of course

Returns
boolean public

Definition at line 555 of file cache_manager.inc.

setAttrValue (   $name,
  $value 
)

Set the value for the passed variable to the passed value

Parameters
string$namethe name of the attribute
string$valuethe new value of the attribute
Returns
boolean public

Definition at line 781 of file cache_manager.inc.


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