1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-09 09:05:23 +02:00

[ticket/13740] Clean up install config file when installation has finished

PHPBB3-13740
This commit is contained in:
Mate Bartus 2015-07-20 18:22:53 +02:00
parent 846ab1d22f
commit 88bf1d7f58
2 changed files with 31 additions and 1 deletions

View File

@ -73,6 +73,13 @@ class config
*/
protected $navigation_data;
/**
* Flag indicating that config file should be cleaned up
*
* @var bool
*/
protected $do_clean_up;
/**
* Constructor
*/
@ -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,
@ -336,6 +350,15 @@ class config
return $this->navigation_data;
}
/**
* 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
*/

View File

@ -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)
{