diff options
author | Mate Bartus <mate.bartus@gmail.com> | 2015-07-20 18:22:53 +0200 |
---|---|---|
committer | Mate Bartus <mate.bartus@gmail.com> | 2015-07-20 18:22:53 +0200 |
commit | 88bf1d7f5802fc37bf77277a8ee65c6fb1f34c87 (patch) | |
tree | 715d008ea1af4bf191bf426f4627466dbf09508e /phpBB | |
parent | 846ab1d22fd33aaeeb1f122c14a4ba6156b7d6d5 (diff) | |
download | forums-88bf1d7f5802fc37bf77277a8ee65c6fb1f34c87.tar forums-88bf1d7f5802fc37bf77277a8ee65c6fb1f34c87.tar.gz forums-88bf1d7f5802fc37bf77277a8ee65c6fb1f34c87.tar.bz2 forums-88bf1d7f5802fc37bf77277a8ee65c6fb1f34c87.tar.xz forums-88bf1d7f5802fc37bf77277a8ee65c6fb1f34c87.zip |
[ticket/13740] Clean up install config file when installation has finished
PHPBB3-13740
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/phpbb/install/helper/config.php | 23 | ||||
-rw-r--r-- | phpBB/phpbb/install/installer.php | 9 |
2 files changed, 31 insertions, 1 deletions
diff --git a/phpBB/phpbb/install/helper/config.php b/phpBB/phpbb/install/helper/config.php index 38fdf960f7..457b64b301 100644 --- a/phpBB/phpbb/install/helper/config.php +++ b/phpBB/phpbb/install/helper/config.php @@ -74,6 +74,13 @@ class config protected $navigation_data; /** + * Flag indicating that config file should be cleaned up + * + * @var bool + */ + protected $do_clean_up; + + /** * Constructor */ public function __construct(\phpbb\filesystem\filesystem_interface $filesystem, \phpbb\php\ini $php_ini, $phpbb_root_path) @@ -81,6 +88,7 @@ class config $this->filesystem = $filesystem; $this->php_ini = $php_ini; $this->phpbb_root_path = $phpbb_root_path; + $this->do_clean_up = false; // Set up data arrays $this->navigation_data = array(); @@ -228,6 +236,12 @@ class config */ public function save_config() { + if ($this->do_clean_up) + { + @unlink($this->install_config_file); + return; + } + // Create array to save $save_array = array( 'installer_config' => $this->installer_config, @@ -337,6 +351,15 @@ class config } /** + * Removes install config file + */ + public function clean_up_config_file() + { + $this->do_clean_up = true; + @unlink($this->install_config_file); + } + + /** * Filling up system_data array */ protected function setup_system_data() diff --git a/phpBB/phpbb/install/installer.php b/phpBB/phpbb/install/installer.php index 548615cb1d..695632472a 100644 --- a/phpBB/phpbb/install/installer.php +++ b/phpBB/phpbb/install/installer.php @@ -219,7 +219,14 @@ class installer // Save install progress try { - $this->install_config->save_config(); + if ($install_finished) + { + $this->install_config->clean_up_config_file(); + } + else + { + $this->install_config->save_config(); + } } catch (installer_config_not_writable_exception $e) { |