Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/flow-flo.../libs/cakephp/cache
File: CacheRegistry.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
[2] Fix | Delete
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
[3] Fix | Delete
*
[4] Fix | Delete
* Licensed under The MIT License
[5] Fix | Delete
* For full copyright and license information, please see the LICENSE.txt
[6] Fix | Delete
* Redistributions of files must retain the above copyright notice.
[7] Fix | Delete
*
[8] Fix | Delete
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
[9] Fix | Delete
* @link https://cakephp.org CakePHP(tm) Project
[10] Fix | Delete
* @since 3.0.0
[11] Fix | Delete
* @license https://opensource.org/licenses/mit-license.php MIT License
[12] Fix | Delete
*/
[13] Fix | Delete
namespace Cake\Cache;
[14] Fix | Delete
[15] Fix | Delete
use BadMethodCallException;
[16] Fix | Delete
use Cake\Core\App;
[17] Fix | Delete
use Cake\Core\ObjectRegistry;
[18] Fix | Delete
use RuntimeException;
[19] Fix | Delete
[20] Fix | Delete
/**
[21] Fix | Delete
* An object registry for cache engines.
[22] Fix | Delete
*
[23] Fix | Delete
* Used by Cake\Cache\Cache to load and manage cache engines.
[24] Fix | Delete
*
[25] Fix | Delete
* @extends \Cake\Core\ObjectRegistry<\Cake\Cache\CacheEngine>
[26] Fix | Delete
*/
[27] Fix | Delete
class CacheRegistry extends ObjectRegistry
[28] Fix | Delete
{
[29] Fix | Delete
/**
[30] Fix | Delete
* Resolve a cache engine classname.
[31] Fix | Delete
*
[32] Fix | Delete
* Part of the template method for Cake\Core\ObjectRegistry::load()
[33] Fix | Delete
*
[34] Fix | Delete
* @param string $class Partial classname to resolve.
[35] Fix | Delete
* @return string|false Either the correct classname or false.
[36] Fix | Delete
*/
[37] Fix | Delete
protected function _resolveClassName($class)
[38] Fix | Delete
{
[39] Fix | Delete
if (is_object($class)) {
[40] Fix | Delete
return $class;
[41] Fix | Delete
}
[42] Fix | Delete
[43] Fix | Delete
return App::className($class, 'Cache/Engine', 'Engine');
[44] Fix | Delete
}
[45] Fix | Delete
[46] Fix | Delete
/**
[47] Fix | Delete
* Throws an exception when a cache engine is missing.
[48] Fix | Delete
*
[49] Fix | Delete
* Part of the template method for Cake\Core\ObjectRegistry::load()
[50] Fix | Delete
*
[51] Fix | Delete
* @param string $class The classname that is missing.
[52] Fix | Delete
* @param string|null $plugin The plugin the cache is missing in.
[53] Fix | Delete
* @return void
[54] Fix | Delete
* @throws \BadMethodCallException
[55] Fix | Delete
*/
[56] Fix | Delete
protected function _throwMissingClassError($class, $plugin)
[57] Fix | Delete
{
[58] Fix | Delete
throw new BadMethodCallException(sprintf('Cache engine %s is not available.', $class));
[59] Fix | Delete
}
[60] Fix | Delete
[61] Fix | Delete
/**
[62] Fix | Delete
* Create the cache engine instance.
[63] Fix | Delete
*
[64] Fix | Delete
* Part of the template method for Cake\Core\ObjectRegistry::load()
[65] Fix | Delete
*
[66] Fix | Delete
* @param string|\Cake\Cache\CacheEngine $class The classname or object to make.
[67] Fix | Delete
* @param string $alias The alias of the object.
[68] Fix | Delete
* @param array $config An array of settings to use for the cache engine.
[69] Fix | Delete
* @return \Cake\Cache\CacheEngine The constructed CacheEngine class.
[70] Fix | Delete
* @throws \RuntimeException when an object doesn't implement the correct interface.
[71] Fix | Delete
*/
[72] Fix | Delete
protected function _create($class, $alias, $config)
[73] Fix | Delete
{
[74] Fix | Delete
if (is_object($class)) {
[75] Fix | Delete
$instance = $class;
[76] Fix | Delete
}
[77] Fix | Delete
[78] Fix | Delete
unset($config['className']);
[79] Fix | Delete
if (!isset($instance)) {
[80] Fix | Delete
$instance = new $class($config);
[81] Fix | Delete
}
[82] Fix | Delete
[83] Fix | Delete
if (!($instance instanceof CacheEngine)) {
[84] Fix | Delete
throw new RuntimeException(
[85] Fix | Delete
'Cache engines must use Cake\Cache\CacheEngine as a base class.'
[86] Fix | Delete
);
[87] Fix | Delete
}
[88] Fix | Delete
[89] Fix | Delete
if (!$instance->init($config)) {
[90] Fix | Delete
throw new RuntimeException(
[91] Fix | Delete
sprintf('Cache engine %s is not properly configured.', get_class($instance))
[92] Fix | Delete
);
[93] Fix | Delete
}
[94] Fix | Delete
[95] Fix | Delete
$config = $instance->getConfig();
[96] Fix | Delete
if (!empty($config['probability']) && time() % $config['probability'] === 0) {
[97] Fix | Delete
$instance->gc();
[98] Fix | Delete
}
[99] Fix | Delete
[100] Fix | Delete
return $instance;
[101] Fix | Delete
}
[102] Fix | Delete
[103] Fix | Delete
/**
[104] Fix | Delete
* Remove a single adapter from the registry.
[105] Fix | Delete
*
[106] Fix | Delete
* @param string $name The adapter name.
[107] Fix | Delete
* @return $this
[108] Fix | Delete
*/
[109] Fix | Delete
public function unload($name)
[110] Fix | Delete
{
[111] Fix | Delete
unset($this->_loaded[$name]);
[112] Fix | Delete
[113] Fix | Delete
return $this;
[114] Fix | Delete
}
[115] Fix | Delete
}
[116] Fix | Delete
[117] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function