mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
Merge branch '3.3.x'
This commit is contained in:
commit
e1b73e4fba
8 changed files with 1 additions and 54 deletions
|
@ -6,7 +6,6 @@ services:
|
|||
- '@dbal.conn'
|
||||
- '@config'
|
||||
- '@finder.factory'
|
||||
- '@router'
|
||||
- '%tables.ext%'
|
||||
- '%core.root_path%'
|
||||
- '@cache'
|
||||
|
|
|
@ -34,7 +34,6 @@ class manager
|
|||
protected $extension_table;
|
||||
protected $phpbb_root_path;
|
||||
protected $cache_name;
|
||||
protected $router;
|
||||
|
||||
/**
|
||||
* Creates a manager and loads information from database
|
||||
|
@ -43,13 +42,12 @@ class manager
|
|||
* @param \phpbb\db\driver\driver_interface $db A database connection
|
||||
* @param \phpbb\config\config $config Config object
|
||||
* @param finder_factory $finder_factory Finder factory
|
||||
* @param \phpbb\routing\router $router Router
|
||||
* @param string $extension_table The name of the table holding extensions
|
||||
* @param string $phpbb_root_path Path to the phpbb includes directory.
|
||||
* @param \phpbb\cache\service|null $cache A cache instance or null
|
||||
* @param string $cache_name The name of the cache variable, defaults to _ext
|
||||
*/
|
||||
public function __construct(ContainerInterface $container, \phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, finder_factory $finder_factory, \phpbb\routing\router $router, $extension_table, $phpbb_root_path, \phpbb\cache\service $cache = null, $cache_name = '_ext')
|
||||
public function __construct(ContainerInterface $container, \phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, finder_factory $finder_factory, $extension_table, $phpbb_root_path, \phpbb\cache\service $cache = null, $cache_name = '_ext')
|
||||
{
|
||||
$this->cache = $cache;
|
||||
$this->cache_name = $cache_name;
|
||||
|
@ -57,7 +55,6 @@ class manager
|
|||
$this->finder_factory = $finder_factory;
|
||||
$this->container = $container;
|
||||
$this->db = $db;
|
||||
$this->router = $router;
|
||||
$this->extension_table = $extension_table;
|
||||
$this->phpbb_root_path = $phpbb_root_path;
|
||||
|
||||
|
@ -240,11 +237,6 @@ class manager
|
|||
'ext_state' => serialize($state),
|
||||
);
|
||||
|
||||
if ($active)
|
||||
{
|
||||
$this->router->without_cache();
|
||||
}
|
||||
|
||||
$this->update_state($name, $extension_data, $this->is_configured($name) ? 'update' : 'insert');
|
||||
|
||||
if ($active)
|
||||
|
@ -294,11 +286,6 @@ class manager
|
|||
$state = $extension->disable_step($old_state);
|
||||
$active = ($state !== false);
|
||||
|
||||
if (!$active)
|
||||
{
|
||||
$this->router->without_cache();
|
||||
}
|
||||
|
||||
$extension_data = array(
|
||||
'ext_active' => $active,
|
||||
'ext_state' => serialize($state),
|
||||
|
|
|
@ -92,11 +92,6 @@ class router implements RouterInterface
|
|||
*/
|
||||
protected $debug_url_matcher;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $use_cache;
|
||||
|
||||
/**
|
||||
* Construct method
|
||||
*
|
||||
|
@ -118,7 +113,6 @@ class router implements RouterInterface
|
|||
$this->cache_dir = $cache_dir;
|
||||
$this->debug_url_generator = $debug_url_generator;
|
||||
$this->debug_url_matcher = $debug_url_matcher;
|
||||
$this->use_cache = true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -198,22 +192,6 @@ class router implements RouterInterface
|
|||
return $this->get_matcher()->match($pathinfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables the use of a cached URL generator and matcher
|
||||
*/
|
||||
public function with_cache()
|
||||
{
|
||||
$this->use_cache = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Disables the use of a cached URL generator and matcher
|
||||
*/
|
||||
public function without_cache()
|
||||
{
|
||||
$this->use_cache = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the UrlMatcher instance associated with this Router.
|
||||
*
|
||||
|
@ -236,12 +214,6 @@ class router implements RouterInterface
|
|||
*/
|
||||
protected function create_dumped_url_matcher()
|
||||
{
|
||||
if (!$this->use_cache)
|
||||
{
|
||||
$this->create_new_url_matcher();
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$cache = new ConfigCache("{$this->cache_dir}url_matcher.{$this->php_ext}", $this->debug_url_matcher);
|
||||
|
@ -290,12 +262,6 @@ class router implements RouterInterface
|
|||
*/
|
||||
protected function create_dumped_url_generator()
|
||||
{
|
||||
if (!$this->use_cache)
|
||||
{
|
||||
$this->create_new_url_generator();
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$cache = new ConfigCache("{$this->cache_dir}url_generator.{$this->php_ext}", $this->debug_url_generator);
|
||||
|
|
|
@ -87,7 +87,6 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
|
|||
$this->db,
|
||||
$this->config,
|
||||
$finder_factory,
|
||||
new phpbb_mock_dummy_router(),
|
||||
'phpbb_ext',
|
||||
__DIR__ . '/../../phpBB/',
|
||||
null
|
||||
|
|
|
@ -186,7 +186,6 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
|
|||
$db,
|
||||
$config,
|
||||
$finder_factory,
|
||||
new phpbb_mock_dummy_router(),
|
||||
'phpbb_ext',
|
||||
__DIR__ . '/',
|
||||
($with_cache) ? new \phpbb\cache\service(new phpbb_mock_cache(), $config, $db, $phpbb_root_path, $php_ext) : null
|
||||
|
|
|
@ -101,7 +101,6 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
|
|||
$this->db,
|
||||
$this->config,
|
||||
$finder_factory,
|
||||
new phpbb_mock_dummy_router(),
|
||||
'phpbb_ext',
|
||||
$this->phpbb_root_path,
|
||||
$this->cache
|
||||
|
|
|
@ -24,6 +24,5 @@ class phpbb_mock_extension_manager extends \phpbb\extension\manager
|
|||
$this->container = $container;
|
||||
$this->config = new \phpbb\config\config(array());
|
||||
$this->finder_factory = new \phpbb\finder\factory(null, false, $this->phpbb_root_path, $phpEx);
|
||||
$this->router = new phpbb_mock_dummy_router();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -276,7 +276,6 @@ class phpbb_functional_test_case extends phpbb_test_case
|
|||
$db,
|
||||
$config,
|
||||
$finder_factory,
|
||||
new phpbb_mock_dummy_router(),
|
||||
self::$config['table_prefix'] . 'ext',
|
||||
__DIR__ . '/',
|
||||
new \phpbb\cache\service($this->get_cache_driver(), $config, $this->db, $phpbb_root_path, $phpEx)
|
||||
|
|
Loading…
Add table
Reference in a new issue