diff --git a/phpBB/config/default/container/services.yml b/phpBB/config/default/container/services.yml index 29774211ff..9e2af7df23 100644 --- a/phpBB/config/default/container/services.yml +++ b/phpBB/config/default/container/services.yml @@ -116,7 +116,6 @@ services: - '@dbal.conn' - '@config' - '@filesystem' - - '@router' - '%tables.ext%' - '%core.root_path%' - '%core.php_ext%' diff --git a/phpBB/phpbb/extension/manager.php b/phpBB/phpbb/extension/manager.php index b60b65dbe2..1ce8425fff 100644 --- a/phpBB/phpbb/extension/manager.php +++ b/phpBB/phpbb/extension/manager.php @@ -33,7 +33,6 @@ class manager protected $extension_table; protected $phpbb_root_path; protected $cache_name; - protected $router; /** * Creates a manager and loads information from database @@ -48,7 +47,7 @@ class manager * @param \phpbb\cache\service $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, \phpbb\filesystem\filesystem_interface $filesystem, \phpbb\routing\router $router, $extension_table, $phpbb_root_path, $php_ext = 'php', \phpbb\cache\service $cache = null, $cache_name = '_ext') + public function __construct(ContainerInterface $container, \phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\filesystem\filesystem_interface $filesystem, $extension_table, $phpbb_root_path, $php_ext = 'php', \phpbb\cache\service $cache = null, $cache_name = '_ext') { $this->cache = $cache; $this->cache_name = $cache_name; @@ -57,7 +56,6 @@ class manager $this->db = $db; $this->extension_table = $extension_table; $this->filesystem = $filesystem; - $this->router = $router; $this->phpbb_root_path = $phpbb_root_path; $this->php_ext = $php_ext; @@ -240,11 +238,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 +287,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), diff --git a/phpBB/phpbb/routing/router.php b/phpBB/phpbb/routing/router.php index 45c1aadcf8..f19886fb0b 100644 --- a/phpBB/phpbb/routing/router.php +++ b/phpBB/phpbb/routing/router.php @@ -80,11 +80,6 @@ class router implements RouterInterface */ protected $cache_dir; - /** - * @var bool - */ - protected $use_cache; - /** * Construct method * @@ -102,7 +97,6 @@ class router implements RouterInterface $this->php_ext = $php_ext; $this->context = new RequestContext(); $this->cache_dir = $cache_dir; - $this->use_cache = true; } /** @@ -182,22 +176,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. * @@ -220,12 +198,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}", defined('DEBUG')); @@ -281,12 +253,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}", defined('DEBUG')); diff --git a/tests/dbal/migrator_test.php b/tests/dbal/migrator_test.php index a383ec3ab0..df0c2506ed 100644 --- a/tests/dbal/migrator_test.php +++ b/tests/dbal/migrator_test.php @@ -80,7 +80,6 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case $this->db, $this->config, new phpbb\filesystem\filesystem(), - new phpbb_mock_dummy_router(), 'phpbb_ext', __DIR__ . '/../../phpBB/', 'php', diff --git a/tests/extension/manager_test.php b/tests/extension/manager_test.php index 4bd1c2b001..86e42b1794 100644 --- a/tests/extension/manager_test.php +++ b/tests/extension/manager_test.php @@ -182,7 +182,6 @@ class phpbb_extension_manager_test extends phpbb_database_test_case $db, $config, new \phpbb\filesystem\filesystem(), - new phpbb_mock_dummy_router(), 'phpbb_ext', __DIR__ . '/', $php_ext, diff --git a/tests/extension/metadata_manager_test.php b/tests/extension/metadata_manager_test.php index 6aafb5dd65..682882c3fc 100644 --- a/tests/extension/metadata_manager_test.php +++ b/tests/extension/metadata_manager_test.php @@ -98,7 +98,6 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case $this->db, $this->config, new \phpbb\filesystem\filesystem(), - new phpbb_mock_dummy_router(), 'phpbb_ext', $this->phpbb_root_path, $this->phpEx, diff --git a/tests/mock/extension_manager.php b/tests/mock/extension_manager.php index 8d6d4469bb..01cd406b5d 100644 --- a/tests/mock/extension_manager.php +++ b/tests/mock/extension_manager.php @@ -26,6 +26,5 @@ class phpbb_mock_extension_manager extends \phpbb\extension\manager $this->container = $container; $this->config = new \phpbb\config\config(array()); $this->user = new \phpbb\user($lang,'\phpbb\datetime'); - $this->router = new phpbb_mock_dummy_router(); } } diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index ae509475c9..7af65b5d5b 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -261,7 +261,6 @@ class phpbb_functional_test_case extends phpbb_test_case $db, $config, new phpbb\filesystem\filesystem(), - new phpbb_mock_dummy_router(), self::$config['table_prefix'] . 'ext', __DIR__ . '/', $phpEx,