mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-27 10:14:47 +02:00
[ticket/12631] Rename finder.not_use_cache to finder.cache
PHPBB3-12631
This commit is contained in:
committed by
Marc Alexander
parent
9308764fae
commit
d31e986815
@@ -19,23 +19,22 @@ namespace phpbb\finder;
|
||||
class factory
|
||||
{
|
||||
protected $cache;
|
||||
protected $not_use_cache;
|
||||
protected $use_cache;
|
||||
protected $phpbb_root_path;
|
||||
protected $php_ext;
|
||||
|
||||
/**
|
||||
* Creates a new finder instance with its dependencies
|
||||
*
|
||||
* @param string $phpbb_root_path Path to the phpbb root directory
|
||||
* @param \phpbb\cache\service $cache A cache instance or null
|
||||
* @param string $php_ext php file extension
|
||||
* @param string $cache_name The name of the cache variable, defaults to
|
||||
* _ext_finder
|
||||
* @param \phpbb\cache\service $cache A cache instance or null
|
||||
* @param bool $not_use_cache Use cache or not
|
||||
* @param string $phpbb_root_path Path to the phpbb root directory
|
||||
* @param string $php_ext php file extension
|
||||
*/
|
||||
public function __construct(/*\phpbb\cache\service */ $cache, $not_use_cache, $phpbb_root_path, $php_ext)
|
||||
public function __construct(/*\phpbb\cache\service */ $cache, $use_cache, $phpbb_root_path, $php_ext)
|
||||
{
|
||||
$this->cache = $cache;
|
||||
$this->not_use_cache = $not_use_cache;
|
||||
$this->use_cache = $use_cache;
|
||||
$this->phpbb_root_path = $phpbb_root_path;
|
||||
$this->php_ext = $php_ext;
|
||||
}
|
||||
@@ -44,10 +43,12 @@ class factory
|
||||
* The cache variable name used to store $this->cached_queries in $this->cache.
|
||||
*
|
||||
* Allows the use of multiple differently configured finders with the same cache.
|
||||
* @var string
|
||||
*
|
||||
* @param string $cache_name The name of the cache variable, defaults to
|
||||
* _ext_finder
|
||||
*/
|
||||
public function get($cache_name = '_ext_finder')
|
||||
{
|
||||
return new finder($this->cache, $this->not_use_cache, $this->phpbb_root_path, $this->php_ext, $cache_name);
|
||||
return new finder($this->cache, $this->use_cache, $this->phpbb_root_path, $this->php_ext, $cache_name);
|
||||
}
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@ class finder
|
||||
protected $extensions;
|
||||
protected $phpbb_root_path;
|
||||
protected $cache;
|
||||
protected $not_use_cache;
|
||||
protected $use_cache;
|
||||
protected $php_ext;
|
||||
|
||||
/**
|
||||
@@ -56,11 +56,11 @@ class finder
|
||||
* @param string $cache_name The name of the cache variable, defaults to
|
||||
* _ext_finder
|
||||
*/
|
||||
public function __construct(/*\phpbb\cache\service */ $cache, $not_use_cache, $phpbb_root_path, $php_ext, $cache_name = '_ext_finder')
|
||||
public function __construct(/*\phpbb\cache\service */ $cache, $use_cache, $phpbb_root_path, $php_ext, $cache_name = '_ext_finder')
|
||||
{
|
||||
$this->phpbb_root_path = $phpbb_root_path;
|
||||
$this->cache = $cache;
|
||||
$this->not_use_cache = $not_use_cache;
|
||||
$this->use_cache = $use_cache;
|
||||
$this->php_ext = $php_ext;
|
||||
$this->cache_name = $cache_name;
|
||||
|
||||
@@ -426,7 +426,7 @@ class finder
|
||||
$this->query['is_dir'] = $is_dir;
|
||||
$query = md5(serialize($this->query) . serialize($extensions));
|
||||
|
||||
if (!$this->not_use_cache && $cache && isset($this->cached_queries[$query]))
|
||||
if ($this->use_cache && $cache && isset($this->cached_queries[$query]))
|
||||
{
|
||||
return $this->cached_queries[$query];
|
||||
}
|
||||
|
Reference in New Issue
Block a user