diff options
-rw-r--r-- | phpBB/config/installer/container/services.yml | 5 | ||||
-rw-r--r-- | phpBB/config/installer/container/services_installer.yml | 1 | ||||
-rw-r--r-- | phpBB/install/app.php | 7 | ||||
-rw-r--r-- | phpBB/install/startup.php | 1 | ||||
-rw-r--r-- | phpBB/phpbb/install/installer.php | 15 | ||||
-rw-r--r-- | tests/test_framework/phpbb_functional_test_case.php | 3 | ||||
-rw-r--r-- | tests/test_framework/phpbb_ui_test_case.php | 3 |
7 files changed, 26 insertions, 9 deletions
diff --git a/phpBB/config/installer/container/services.yml b/phpBB/config/installer/container/services.yml index e7325399ad..5626724dd0 100644 --- a/phpBB/config/installer/container/services.yml +++ b/phpBB/config/installer/container/services.yml @@ -9,6 +9,11 @@ imports: - { resource: ../../default/container/services_twig.yml } services: + cache.driver: + class: %cache.driver.class% + arguments: + - "%core.root_path%/cache/installer/" + config: class: phpbb\config\config arguments: diff --git a/phpBB/config/installer/container/services_installer.yml b/phpBB/config/installer/container/services_installer.yml index 667ff2bafd..c2c730e62c 100644 --- a/phpBB/config/installer/container/services_installer.yml +++ b/phpBB/config/installer/container/services_installer.yml @@ -86,6 +86,7 @@ services: class: phpbb\install\installer abstract: true arguments: + - @cache.driver - @installer.helper.config - @path_helper diff --git a/phpBB/install/app.php b/phpBB/install/app.php index 9346351aba..9664f92cf1 100644 --- a/phpBB/install/app.php +++ b/phpBB/install/app.php @@ -30,7 +30,6 @@ $phpbb_filesystem = $phpbb_installer_container->get('filesystem'); /** @var \phpbb\template\template $template */ $template = $phpbb_installer_container->get('template'); - // Path to templates $paths = array($phpbb_root_path . 'install/update/new/adm/style', $phpbb_admin_path . 'style'); $paths = array_filter($paths, 'is_dir'); @@ -42,17 +41,17 @@ $template->set_custom_style(array( ), ), $paths); -/* @var $phpbb_dispatcher \phpbb\event\dispatcher */ +/** @var $phpbb_dispatcher \phpbb\event\dispatcher */ $phpbb_dispatcher = $phpbb_installer_container->get('dispatcher'); /** @var \phpbb\language\language $language */ $language = $phpbb_installer_container->get('language'); $language->add_lang(array('common', 'acp/common', 'acp/board', 'install', 'posting')); -/* @var $http_kernel \Symfony\Component\HttpKernel\HttpKernel */ +/** @var $http_kernel \Symfony\Component\HttpKernel\HttpKernel */ $http_kernel = $phpbb_installer_container->get('http_kernel'); -/* @var $symfony_request \phpbb\symfony_request */ +/** @var $symfony_request \phpbb\symfony_request */ $symfony_request = $phpbb_installer_container->get('symfony_request'); $response = $http_kernel->handle($symfony_request); $response->send(); diff --git a/phpBB/install/startup.php b/phpBB/install/startup.php index 766f6be38a..b40face4f8 100644 --- a/phpBB/install/startup.php +++ b/phpBB/install/startup.php @@ -81,4 +81,5 @@ $config_path = (file_exists($other_config_path . '/installer/config.yml')) ? $ot $phpbb_installer_container = $phpbb_installer_container_builder ->with_config_path($config_path) + ->with_custom_parameters(array('cache.driver.class' => 'phpbb\cache\driver\file')) ->get_container(); diff --git a/phpBB/phpbb/install/installer.php b/phpBB/phpbb/install/installer.php index 77e0a896bc..a41b4cd6a6 100644 --- a/phpBB/phpbb/install/installer.php +++ b/phpBB/phpbb/install/installer.php @@ -13,6 +13,7 @@ namespace phpbb\install; +use phpbb\cache\driver\driver_interface; use phpbb\di\ordered_service_collection; use phpbb\install\exception\installer_config_not_writable_exception; use phpbb\install\exception\jump_to_restart_point_exception; @@ -26,6 +27,11 @@ use phpbb\path_helper; class installer { /** + * @var driver_interface + */ + protected $cache; + + /** * @var config */ protected $install_config; @@ -55,11 +61,13 @@ class installer /** * Constructor * - * @param config $config Installer config handler - * @param path_helper $path_helper Path helper + * @param driver_interface $cache Cache service + * @param config $config Installer config handler + * @param path_helper $path_helper Path helper */ - public function __construct(config $config, path_helper $path_helper) + public function __construct(driver_interface $cache, config $config, path_helper $path_helper) { + $this->cache = $cache; $this->install_config = $config; $this->installer_modules = null; $this->web_root = $path_helper->get_web_root_path(); @@ -235,6 +243,7 @@ class installer if ($install_finished || $fail_cleanup) { $this->install_config->clean_up_config_file(); + $this->cache->purge(); } else { diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index 9adbda9fc6..323d97ff42 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -295,7 +295,8 @@ class phpbb_functional_test_case extends phpbb_test_case 'installer.create_config_file.options' => [ 'debug' => true, 'environment' => 'test', - ] + ], + 'cache.driver.class' => 'phpbb\cache\driver\file' ]) ->without_compiled_container() ->get_container(); diff --git a/tests/test_framework/phpbb_ui_test_case.php b/tests/test_framework/phpbb_ui_test_case.php index 5da176e929..e118801972 100644 --- a/tests/test_framework/phpbb_ui_test_case.php +++ b/tests/test_framework/phpbb_ui_test_case.php @@ -128,7 +128,8 @@ class phpbb_ui_test_case extends phpbb_test_case 'installer.create_config_file.options' => [ 'debug' => true, 'environment' => 'test', - ] + ], + 'cache.driver.class' => 'phpbb\cache\driver\file' ]) ->without_compiled_container() ->get_container(); |