mirror of
https://github.com/smarty-php/smarty.git
synced 2026-04-29 02:03:31 +02:00
- reformat all code for unique style
This commit is contained in:
@@ -50,7 +50,8 @@ abstract class Smarty_CacheResource
|
||||
*
|
||||
* @return bool true or false if the cached content does not exist
|
||||
*/
|
||||
abstract public function process(Smarty_Internal_Template $_template, Smarty_Template_Cached $cached = null, $update = false);
|
||||
abstract public function process(Smarty_Internal_Template $_template, Smarty_Template_Cached $cached = null,
|
||||
$update = false);
|
||||
|
||||
/**
|
||||
* Write the rendered template output to cache
|
||||
@@ -185,24 +186,24 @@ abstract class Smarty_CacheResource
|
||||
}
|
||||
|
||||
// try smarty's cache
|
||||
if (isset($smarty->_cache['cacheresource_handlers'][$type])) {
|
||||
return $smarty->_cache['cacheresource_handlers'][$type];
|
||||
if (isset($smarty->_cache[ 'cacheresource_handlers' ][ $type ])) {
|
||||
return $smarty->_cache[ 'cacheresource_handlers' ][ $type ];
|
||||
}
|
||||
|
||||
// try registered resource
|
||||
if (isset($smarty->registered_cache_resources[$type])) {
|
||||
if (isset($smarty->registered_cache_resources[ $type ])) {
|
||||
// do not cache these instances as they may vary from instance to instance
|
||||
return $smarty->_cache['cacheresource_handlers'][$type] = $smarty->registered_cache_resources[$type];
|
||||
return $smarty->_cache[ 'cacheresource_handlers' ][ $type ] = $smarty->registered_cache_resources[ $type ];
|
||||
}
|
||||
// try sysplugins dir
|
||||
if (isset(self::$sysplugins[$type])) {
|
||||
if (isset(self::$sysplugins[ $type ])) {
|
||||
$cache_resource_class = 'Smarty_Internal_CacheResource_' . ucfirst($type);
|
||||
return $smarty->_cache['cacheresource_handlers'][$type] = new $cache_resource_class();
|
||||
return $smarty->_cache[ 'cacheresource_handlers' ][ $type ] = new $cache_resource_class();
|
||||
}
|
||||
// try plugins dir
|
||||
$cache_resource_class = 'Smarty_CacheResource_' . ucfirst($type);
|
||||
if ($smarty->loadPlugin($cache_resource_class)) {
|
||||
return $smarty->_cache['cacheresource_handlers'][$type] = new $cache_resource_class();
|
||||
return $smarty->_cache[ 'cacheresource_handlers' ][ $type ] = new $cache_resource_class();
|
||||
}
|
||||
// give up
|
||||
throw new SmartyException("Unable to load cache resource '{$type}'");
|
||||
|
||||
Reference in New Issue
Block a user