aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/install
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb/install')
-rw-r--r--phpBB/phpbb/install/controller/helper.php1
-rw-r--r--phpBB/phpbb/install/module/install_database/task/add_config_settings.php2
-rw-r--r--phpBB/phpbb/install/module/install_database/task/create_schema.php13
-rw-r--r--phpBB/phpbb/install/module/install_filesystem/task/create_config_file.php29
-rw-r--r--phpBB/phpbb/install/module/install_finish/task/notify_user.php15
-rw-r--r--phpBB/phpbb/install/module/install_finish/task/populate_migrations.php2
-rw-r--r--phpBB/phpbb/install/module/obtain_data/task/obtain_board_data.php2
-rw-r--r--phpBB/phpbb/install/module/obtain_data/task/obtain_email_data.php2
8 files changed, 50 insertions, 16 deletions
diff --git a/phpBB/phpbb/install/controller/helper.php b/phpBB/phpbb/install/controller/helper.php
index bfa9ec6238..fdb07d9c4a 100644
--- a/phpBB/phpbb/install/controller/helper.php
+++ b/phpBB/phpbb/install/controller/helper.php
@@ -204,6 +204,7 @@ class helper
if ($lang !== null)
{
$this->language->set_user_language($lang, true);
+ $this->installer_config->set('user_language', $lang);
}
}
diff --git a/phpBB/phpbb/install/module/install_database/task/add_config_settings.php b/phpBB/phpbb/install/module/install_database/task/add_config_settings.php
index 25da36e01d..6fb03ff73d 100644
--- a/phpBB/phpbb/install/module/install_database/task/add_config_settings.php
+++ b/phpBB/phpbb/install/module/install_database/task/add_config_settings.php
@@ -233,7 +233,7 @@ class add_config_settings extends \phpbb\install\task_base
SET username = '" . $this->db->sql_escape($this->install_config->get('admin_name')) . "',
user_password='" . $this->password_manager->hash($this->install_config->get('admin_passwd')) . "',
user_ip = '" . $this->db->sql_escape($user_ip) . "',
- user_lang = '" . $this->db->sql_escape($this->install_config->get('language')) . "',
+ user_lang = '" . $this->db->sql_escape($this->install_config->get('user_language', 'en')) . "',
user_email='" . $this->db->sql_escape($this->install_config->get('board_email')) . "',
user_dateformat='" . $this->db->sql_escape($this->language->lang('default_dateformat')) . "',
user_email_hash = " . $this->db->sql_escape(phpbb_email_hash($this->install_config->get('board_email'))) . ",
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..5268b85a42 100644
--- a/phpBB/phpbb/install/module/install_finish/task/notify_user.php
+++ b/phpBB/phpbb/install/module/install_finish/task/notify_user.php
@@ -41,6 +41,11 @@ class notify_user extends \phpbb\install\task_base
protected $config;
/**
+ * @var \phpbb\language\language
+ */
+ protected $language;
+
+ /**
* @var \phpbb\log\log_interface
*/
protected $log;
@@ -75,6 +80,7 @@ class notify_user extends \phpbb\install\task_base
$this->iohandler = $iohandler;
$this->auth = $container->get('auth');
+ $this->language = $container->get('language');
$this->log = $container->get('log');
$this->user = $container->get('user');
$this->phpbb_root_path = $phpbb_root_path;
@@ -86,6 +92,8 @@ class notify_user extends \phpbb\install\task_base
$container->get('cache.driver'),
$container->get_parameter('tables.config')
);
+
+ parent::__construct(true);
}
/**
@@ -100,8 +108,13 @@ class notify_user extends \phpbb\install\task_base
{
include ($this->phpbb_root_path . 'includes/functions_messenger.' . $this->php_ext);
+ // functions_messenger.php uses config to determine language paths
+ // Remove when able
+ global $config;
+ $config = $this->config;
+
$messenger = new \messenger(false);
- $messenger->template('installed', $this->install_config->get('language'));
+ $messenger->template('installed', $this->install_config->get('user_language', 'en'));
$messenger->to($this->config['board_email'], $this->install_config->get('admin_name'));
$messenger->anti_abuse_headers($this->config, $this->user);
$messenger->assign_vars(array(
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);
}
/**
diff --git a/phpBB/phpbb/install/module/obtain_data/task/obtain_board_data.php b/phpBB/phpbb/install/module/obtain_data/task/obtain_board_data.php
index 0726cc449c..4e977981ce 100644
--- a/phpBB/phpbb/install/module/obtain_data/task/obtain_board_data.php
+++ b/phpBB/phpbb/install/module/obtain_data/task/obtain_board_data.php
@@ -126,7 +126,7 @@ class obtain_board_data extends \phpbb\install\task_base implements \phpbb\insta
}
// Use language because we only check this to be valid
- $default_lang = $this->install_config->get('language', '');
+ $default_lang = $this->install_config->get('user_language', 'en');
$langs = $this->language_helper->get_available_languages();
$lang_options = array();
diff --git a/phpBB/phpbb/install/module/obtain_data/task/obtain_email_data.php b/phpBB/phpbb/install/module/obtain_data/task/obtain_email_data.php
index ae7526a9e3..b04b8e353f 100644
--- a/phpBB/phpbb/install/module/obtain_data/task/obtain_email_data.php
+++ b/phpBB/phpbb/install/module/obtain_data/task/obtain_email_data.php
@@ -116,12 +116,12 @@ class obtain_email_data extends \phpbb\install\task_base implements \phpbb\insta
),
'smtp_host' => array(
'label' => 'SMTP_SERVER',
- 'description' => 'SMTP_SERVER_EXPLAIN',
'type' => 'text',
'default' => $smtp_host,
),
'smtp_auth' => array(
'label' => 'SMTP_AUTH_METHOD',
+ 'description' => 'SMTP_AUTH_METHOD_EXPLAIN',
'type' => 'select',
'options' => $auth_options,
),