mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 05:50:42 +02:00
[ticket/12631] Add finder.not_use_cache
PHPBB3-12631
This commit is contained in:
committed by
Marc Alexander
parent
38024d14bf
commit
9308764fae
53
phpBB/phpbb/finder/factory.php
Normal file
53
phpBB/phpbb/finder/factory.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* This file is part of the phpBB Forum Software package.
|
||||
*
|
||||
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
||||
* @license GNU General Public License, version 2 (GPL-2.0)
|
||||
*
|
||||
* For full copyright and license information, please see
|
||||
* the docs/CREDITS.txt file.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace phpbb\finder;
|
||||
|
||||
/**
|
||||
* The finder provides a simple way to locate files in the core and a set of extensions
|
||||
*/
|
||||
class factory
|
||||
{
|
||||
protected $cache;
|
||||
protected $not_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
|
||||
*/
|
||||
public function __construct(/*\phpbb\cache\service */ $cache, $not_use_cache, $phpbb_root_path, $php_ext)
|
||||
{
|
||||
$this->cache = $cache;
|
||||
$this->not_use_cache = $not_use_cache;
|
||||
$this->phpbb_root_path = $phpbb_root_path;
|
||||
$this->php_ext = $php_ext;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user