diff options
Diffstat (limited to 'phpBB/phpbb')
4 files changed, 34 insertions, 12 deletions
diff --git a/phpBB/phpbb/install/module/install_database/task/create_schema.php b/phpBB/phpbb/install/module/install_database/task/create_schema.php index 7cc521eee8..cabb78787f 100644 --- a/phpBB/phpbb/install/module/install_database/task/create_schema.php +++ b/phpBB/phpbb/install/module/install_database/task/create_schema.php @@ -80,6 +80,16 @@ class create_schema extends \phpbb\install\task_base $factory = new \phpbb\db\tools\factory(); $this->db = new $dbms(); + $this->db->sql_connect( + $config->get('dbhost'), + $config->get('dbuser'), + $config->get('dbpasswd'), + $config->get('dbname'), + $config->get('dbport'), + false, + false + ); + $this->config = $config; $this->db_tools = $factory->get($this->db); $this->database_helper = $db_helper; @@ -89,9 +99,6 @@ class create_schema extends \phpbb\install\task_base $this->php_ext = $php_ext; parent::__construct(true); - - // Connect to DB - $this->db->sql_connect($config->get('dbhost'), $config->get('dbuser'), $config->get('dbpasswd'), $config->get('dbname'), $config->get('dbport'), false, false); } /** diff --git a/phpBB/phpbb/install/module/install_filesystem/task/create_config_file.php b/phpBB/phpbb/install/module/install_filesystem/task/create_config_file.php index 337d401216..e0890a929c 100644 --- a/phpBB/phpbb/install/module/install_filesystem/task/create_config_file.php +++ b/phpBB/phpbb/install/module/install_filesystem/task/create_config_file.php @@ -51,6 +51,11 @@ class create_config_file extends \phpbb\install\task_base protected $php_ext; /** + * @var array + */ + protected $options; + + /** * Constructor * * @param \phpbb\filesystem\filesystem_interface $filesystem @@ -59,13 +64,15 @@ class create_config_file extends \phpbb\install\task_base * @param \phpbb\install\helper\iohandler\iohandler_interface $iohandler * @param string $phpbb_root_path * @param string $php_ext + * @param array $options */ public function __construct(\phpbb\filesystem\filesystem_interface $filesystem, \phpbb\install\helper\config $install_config, \phpbb\install\helper\database $db_helper, \phpbb\install\helper\iohandler\iohandler_interface $iohandler, $phpbb_root_path, - $php_ext) + $php_ext, + $options = array()) { $this->install_config = $install_config; $this->db_helper = $db_helper; @@ -73,6 +80,11 @@ class create_config_file extends \phpbb\install\task_base $this->iohandler = $iohandler; $this->phpbb_root_path = $phpbb_root_path; $this->php_ext = $php_ext; + $this->options = array_merge(array( + 'debug' => false, + 'debug_container' => false, + 'environment' => null, + ), $options); parent::__construct(true); } @@ -93,7 +105,7 @@ class create_config_file extends \phpbb\install\task_base $config_written = false; } - $config_content = $this->get_config_data(); + $config_content = $this->get_config_data($this->options['debug'], $this->options['debug_container'], $this->options['environment']); if (!@fwrite($fp, $config_content)) { @@ -145,15 +157,14 @@ class create_config_file extends \phpbb\install\task_base /** * Returns the content which should be dumped to config.php * - * @param bool $debug If the debug constants should be enabled by default or not - * @param bool $debug_container If the container should be compiled on + * @param bool $debug If the debug constants should be enabled by default or not + * @param bool $debug_container If the container should be compiled on * every page load or not - * @param bool $debug_test If the DEBUG_TEST constant should be added - * NOTE: Only for use within the testing framework + * @param string $environment The environment to use * * @return string content to be written to the config file */ - protected function get_config_data($debug = false, $debug_container = false, $debug_test = false) + protected function get_config_data($debug = false, $debug_container = false, $environment = null) { $config_content = "<?php\n"; $config_content .= "// phpBB 3.2.x auto-generated configuration file\n// Do not change anything in this file!\n"; @@ -184,7 +195,7 @@ class create_config_file extends \phpbb\install\task_base $config_content .= "\n@define('PHPBB_INSTALLED', true);\n"; $config_content .= "// @define('PHPBB_DISPLAY_LOAD_TIME', true);\n"; - if ($debug_test) + if ($environment) { $config_content .= "@define('PHPBB_ENVIRONMENT', 'test');\n"; } @@ -206,7 +217,7 @@ class create_config_file extends \phpbb\install\task_base $config_content .= "// @define('DEBUG_CONTAINER', true);\n"; } - if ($debug_test) + if ($environment === 'test') { $config_content .= "@define('DEBUG_TEST', true);\n"; diff --git a/phpBB/phpbb/install/module/install_finish/task/notify_user.php b/phpBB/phpbb/install/module/install_finish/task/notify_user.php index 0af76f6f60..83c03ce367 100644 --- a/phpBB/phpbb/install/module/install_finish/task/notify_user.php +++ b/phpBB/phpbb/install/module/install_finish/task/notify_user.php @@ -86,6 +86,8 @@ class notify_user extends \phpbb\install\task_base $container->get('cache.driver'), $container->get_parameter('tables.config') ); + + parent::__construct(true); } /** diff --git a/phpBB/phpbb/install/module/install_finish/task/populate_migrations.php b/phpBB/phpbb/install/module/install_finish/task/populate_migrations.php index b2a4800f86..8629d9aea3 100644 --- a/phpBB/phpbb/install/module/install_finish/task/populate_migrations.php +++ b/phpBB/phpbb/install/module/install_finish/task/populate_migrations.php @@ -37,6 +37,8 @@ class populate_migrations extends \phpbb\install\task_base { $this->extension_manager = $container->get('ext.manager'); $this->migrator = $container->get('migrator'); + + parent::__construct(true); } /** |