Drupal 8  8.0.2
ThemeRegistry Class Reference
Inheritance diagram for ThemeRegistry:

Public Member Functions

 __construct ($cid, CacheBackendInterface $cache, LockBackendInterface $lock, $tags=array(), $modules_loaded=FALSE)
 
 initializeRegistry ()
 
 has ($key)
 
 get ($key)
 
 resolveCacheMiss ($key)
 
- Public Member Functions inherited from CacheCollector
 __construct ($cid, CacheBackendInterface $cache, LockBackendInterface $lock, array $tags=array())
 
 has ($key)
 
 get ($key)
 
 set ($key, $value)
 
 delete ($key)
 
 reset ()
 
 clear ()
 
 destruct ()
 

Protected Member Functions

 updateCache ($lock=TRUE)
 
- Protected Member Functions inherited from CacheCollector
 getCid ()
 
 persist ($key, $persist=TRUE)
 
 resolveCacheMiss ($key)
 
 updateCache ($lock=TRUE)
 
 normalizeLockName ($cid)
 
 lazyLoadCache ()
 
 invalidateCache ()
 

Protected Attributes

 $persistable
 
 $completeRegistry
 
- Protected Attributes inherited from CacheCollector
 $cid
 
 $tags
 
 $cache
 
 $lock
 
 $keysToPersist = array()
 
 $keysToRemove = array()
 
 $storage = array()
 
 $cacheCreated
 
 $cacheInvalidated = FALSE
 
 $cacheLoaded = FALSE
 

Detailed Description

Builds the run-time theme registry.

A cache collector to allow the theme registry to be accessed as a complete registry, while internally caching only the parts of the registry that are actually in use on the site. On cache misses the complete theme registry is loaded and used to update the run-time cache.

Constructor & Destructor Documentation

__construct (   $cid,
CacheBackendInterface  $cache,
LockBackendInterface  $lock,
  $tags = array(),
  $modules_loaded = FALSE 
)

Constructs a ThemeRegistry object.

Parameters
string$cidThe cid for the array being cached.
\Drupal\Core\Cache\CacheBackendInterface$cacheThe cache backend.
\Drupal\Core\Lock\LockBackendInterface$lockThe lock backend.
array$tags(optional) The tags to specify for the cache item.
bool$modules_loadedWhether all modules have already been loaded.

References Drupal\cache(), Drupal\hasRequest(), ThemeRegistry\initializeRegistry(), Drupal\lock(), CacheCollector\persist(), Drupal\request(), and ThemeRegistry\updateCache().

Here is the call graph for this function:

Member Function Documentation

get (   $key)

{Gets value from the cache.

Parameters
string$keyKey that identifies the data.
Returns
mixed The corresponding cache data.
}

Implements CacheCollectorInterface.

References ThemeRegistry\resolveCacheMiss().

Here is the call graph for this function:

has (   $key)

{Returns whether data exists for this key.

Parameters
string$keyKey that identifies the data.
}

Implements CacheCollectorInterface.

initializeRegistry ( )

Initializes the full theme registry.

Returns
An array with the keys of the full theme registry, but the values initialized to NULL.

References Drupal\service().

Referenced by ThemeRegistry\__construct(), and ThemeRegistry\updateCache().

Here is the call graph for this function:

Here is the caller graph for this function:

resolveCacheMiss (   $key)

{}

References CacheCollector\persist(), and Drupal\service().

Referenced by ThemeRegistry\get().

Here is the call graph for this function:

Here is the caller graph for this function:

updateCache (   $lock = TRUE)
protected

{}

References Drupal\cache(), ThemeRegistry\initializeRegistry(), Drupal\lock(), and Cache\PERMANENT.

Referenced by ThemeRegistry\__construct().

Here is the call graph for this function:

Here is the caller graph for this function:

Field Documentation

$completeRegistry
protected

The complete theme registry array.

$persistable
protected

Whether the partial registry can be persisted to the cache.

This is only allowed if all modules and the request method is GET. _theme() should be very rarely called on POST requests and this avoids polluting the runtime cache.


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