aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/install')
-rw-r--r--phpBB/install/convertors/convert_phpbb20.php4
-rw-r--r--phpBB/install/convertors/functions_phpbb20.php45
-rw-r--r--phpBB/install/data/confusables.php8
-rw-r--r--phpBB/install/data/new_normalizer.php197
-rw-r--r--phpBB/install/database_update.php21
-rw-r--r--phpBB/install/index.php35
-rw-r--r--phpBB/install/install_convert.php45
-rw-r--r--phpBB/install/install_install.php24
-rw-r--r--phpBB/install/install_update.php10
-rw-r--r--phpBB/install/schemas/schema_data.sql2
10 files changed, 115 insertions, 276 deletions
diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php
index 511f850679..5d2398528b 100644
--- a/phpBB/install/convertors/convert_phpbb20.php
+++ b/phpBB/install/convertors/convert_phpbb20.php
@@ -233,11 +233,11 @@ if (!$get_info)
$user_id = (int) $src_db->sql_fetchfield('max_user_id');
$src_db->sql_freeresult($result);
- set_config('increment_user_id', ($user_id + 1), true);
+ $config->set('increment_user_id', ($user_id + 1), false);
}
else
{
- set_config('increment_user_id', 0, true);
+ $config->set('increment_user_id', 0, false);
}
// Overwrite maximum avatar width/height
diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php
index 817c007274..f8a6954634 100644
--- a/phpBB/install/convertors/functions_phpbb20.php
+++ b/phpBB/install/convertors/functions_phpbb20.php
@@ -514,12 +514,12 @@ function phpbb_user_id($user_id)
// If there is a user id 1, we need to increment user ids. :/
if ($id === 1)
{
- set_config('increment_user_id', ($max_id + 1), true);
+ $config->set('increment_user_id', ($max_id + 1), false);
$config['increment_user_id'] = $max_id + 1;
}
else
{
- set_config('increment_user_id', 0, true);
+ $config->set('increment_user_id', 0, false);
$config['increment_user_id'] = 0;
}
}
@@ -1682,29 +1682,29 @@ function phpbb_import_attach_config()
}
$src_db->sql_freeresult($result);
- set_config('allow_attachments', 1);
+ $config->set('allow_attachments', 1);
// old attachment mod? Must be very old if this entry do not exist...
if (!empty($attach_config['display_order']))
{
- set_config('display_order', $attach_config['display_order']);
- }
- set_config('max_filesize', $attach_config['max_filesize']);
- set_config('max_filesize_pm', $attach_config['max_filesize_pm']);
- set_config('attachment_quota', $attach_config['attachment_quota']);
- set_config('max_attachments', $attach_config['max_attachments']);
- set_config('max_attachments_pm', $attach_config['max_attachments_pm']);
- set_config('allow_pm_attach', $attach_config['allow_pm_attach']);
-
- set_config('img_display_inlined', $attach_config['img_display_inlined']);
- set_config('img_max_width', $attach_config['img_max_width']);
- set_config('img_max_height', $attach_config['img_max_height']);
- set_config('img_link_width', $attach_config['img_link_width']);
- set_config('img_link_height', $attach_config['img_link_height']);
- set_config('img_create_thumbnail', $attach_config['img_create_thumbnail']);
- set_config('img_max_thumb_width', 400);
- set_config('img_min_thumb_filesize', $attach_config['img_min_thumb_filesize']);
- set_config('img_imagick', $attach_config['img_imagick']);
+ $config->set('display_order', $attach_config['display_order']);
+ }
+ $config->set('max_filesize', $attach_config['max_filesize']);
+ $config->set('max_filesize_pm', $attach_config['max_filesize_pm']);
+ $config->set('attachment_quota', $attach_config['attachment_quota']);
+ $config->set('max_attachments', $attach_config['max_attachments']);
+ $config->set('max_attachments_pm', $attach_config['max_attachments_pm']);
+ $config->set('allow_pm_attach', $attach_config['allow_pm_attach']);
+
+ $config->set('img_display_inlined', $attach_config['img_display_inlined']);
+ $config->set('img_max_width', $attach_config['img_max_width']);
+ $config->set('img_max_height', $attach_config['img_max_height']);
+ $config->set('img_link_width', $attach_config['img_link_width']);
+ $config->set('img_link_height', $attach_config['img_link_height']);
+ $config->set('img_create_thumbnail', $attach_config['img_create_thumbnail']);
+ $config->set('img_max_thumb_width', 400);
+ $config->set('img_min_thumb_filesize', $attach_config['img_min_thumb_filesize']);
+ $config->set('img_imagick', $attach_config['img_imagick']);
}
/**
@@ -1926,7 +1926,7 @@ function phpbb_check_username_collisions()
function phpbb_convert_timezone($timezone)
{
global $config, $db, $phpbb_root_path, $phpEx, $table_prefix;
- $timezone_migration = new \phpbb\db\migration\data\v310\timezone($config, $db, new \phpbb\db\tools($db), $phpbb_root_path, $phpEx, $table_prefix);
+ $timezone_migration = new \phpbb\db\migration\data\v310\timezone($config, $db, new \phpbb\db\tools\tools($db), $phpbb_root_path, $phpEx, $table_prefix);
return $timezone_migration->convert_phpbb30_timezone($timezone, 0);
}
@@ -1974,6 +1974,7 @@ function phpbb_convert_password_hash($hash)
{
global $phpbb_container;
+ /* @var $manager \phpbb\passwords\manager */
$manager = $phpbb_container->get('passwords.manager');
$hash = $manager->hash($hash, '$H$');
diff --git a/phpBB/install/data/confusables.php b/phpBB/install/data/confusables.php
index e3e8c41e62..992207c1ef 100644
--- a/phpBB/install/data/confusables.php
+++ b/phpBB/install/data/confusables.php
@@ -633,14 +633,8 @@ function utf8_new_case_fold_nfkc($text, $option = 'full')
// do the case fold
$text = utf8_new_case_fold($text, $option);
- if (!class_exists('utf_normalizer'))
- {
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);
- }
-
// convert to NFKC
- utf_new_normalizer::nfkc($text);
+ $text = Normalizer::normalize($text, Normalizer::NFKC);
// FC_NFKC_Closure, http://www.unicode.org/Public/5.0.0/ucd/DerivedNormalizationProps.txt
$text = strtr($text, $fc_nfkc_closure);
diff --git a/phpBB/install/data/new_normalizer.php b/phpBB/install/data/new_normalizer.php
deleted file mode 100644
index 52652a4f6d..0000000000
--- a/phpBB/install/data/new_normalizer.php
+++ /dev/null
@@ -1,197 +0,0 @@
-<?php
-/**
-*
-* This file is part of the phpBB Forum Software package.
-*
-* @copyright (c) phpBB Limited <https://www.phpbb.com>
-* @license GNU General Public License, version 2 (GPL-2.0)
-*
-* For full copyright and license information, please see
-* the docs/CREDITS.txt file.
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* A wrapper function for the normalizer which takes care of including the class if required and modifies the passed strings
-* to be in NFC (Normalization Form Composition).
-*
-* @param mixed $strings a string or an array of strings to normalize
-* @return mixed the normalized content, preserving array keys if array given.
-*/
-function utf8_new_normalize_nfc($strings)
-{
- if (empty($strings))
- {
- return $strings;
- }
-
- if (!is_array($strings))
- {
- utf_new_normalizer::nfc($strings);
- }
- else if (is_array($strings))
- {
- foreach ($strings as $key => $string)
- {
- if (is_array($string))
- {
- foreach ($string as $_key => $_string)
- {
- utf_new_normalizer::nfc($strings[$key][$_key]);
- }
- }
- else
- {
- utf_new_normalizer::nfc($strings[$key]);
- }
- }
- }
-
- return $strings;
-}
-
-class utf_new_normalizer
-{
- /**
- * Validate, cleanup and normalize a string
- *
- * The ultimate convenience function! Clean up invalid UTF-8 sequences,
- * and convert to Normal Form C, canonical composition.
- *
- * @param string &$str The dirty string
- * @return string The same string, all shiny and cleaned-up
- */
- function cleanup(&$str)
- {
- // The string below is the list of all autorized characters, sorted by frequency in latin text
- $pos = strspn($str, "\x20\x65\x69\x61\x73\x6E\x74\x72\x6F\x6C\x75\x64\x5D\x5B\x63\x6D\x70\x27\x0A\x67\x7C\x68\x76\x2E\x66\x62\x2C\x3A\x3D\x2D\x71\x31\x30\x43\x32\x2A\x79\x78\x29\x28\x4C\x39\x41\x53\x2F\x50\x22\x45\x6A\x4D\x49\x6B\x33\x3E\x35\x54\x3C\x44\x34\x7D\x42\x7B\x38\x46\x77\x52\x36\x37\x55\x47\x4E\x3B\x4A\x7A\x56\x23\x48\x4F\x57\x5F\x26\x21\x4B\x3F\x58\x51\x25\x59\x5C\x09\x5A\x2B\x7E\x5E\x24\x40\x60\x7F\x0D");
- $len = strlen($str);
-
- if ($pos == $len)
- {
- // ASCII strings with no special chars return immediately
- return;
- }
-
- // Note: we do not check for $GLOBALS['utf_canonical_decomp']. It is assumed they are always loaded together
- if (!isset($GLOBALS['utf_nfc_qc']))
- {
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_nfc_qc.' . $phpEx);
- }
-
- if (!isset($GLOBALS['utf_canonical_decomp']))
- {
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_canonical_decomp.' . $phpEx);
- }
-
- // Replace any byte in the range 0x00..0x1F, except for \r, \n and \t
- // We replace those characters with a 0xFF byte, which is illegal in UTF-8 and will in turn be replaced with a UTF replacement char
- $str = strtr(
- $str,
- "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F",
- "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF"
- );
-
- $str = utf_new_normalizer::recompose($str, $pos, $len, $GLOBALS['utf_nfc_qc'], $GLOBALS['utf_canonical_decomp']);
- }
-
- /**
- * Validate and normalize a UTF string to NFC
- *
- * @param string &$str Unchecked UTF string
- * @return string The string, validated and in normal form
- */
- function nfc(&$str)
- {
- $pos = strspn($str, UTF8_ASCII_RANGE);
- $len = strlen($str);
-
- if ($pos == $len)
- {
- // ASCII strings return immediately
- return;
- }
-
- if (!isset($GLOBALS['utf_nfc_qc']))
- {
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_nfc_qc.' . $phpEx);
- }
-
- if (!isset($GLOBALS['utf_canonical_decomp']))
- {
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_canonical_decomp.' . $phpEx);
- }
-
- $str = utf_new_normalizer::recompose($str, $pos, $len, $GLOBALS['utf_nfc_qc'], $GLOBALS['utf_canonical_decomp']);
- }
-
- /**
- * Validate and normalize a UTF string to NFKC
- *
- * @param string &$str Unchecked UTF string
- * @return string The string, validated and in normal form
- */
- function nfkc(&$str)
- {
- $pos = strspn($str, UTF8_ASCII_RANGE);
- $len = strlen($str);
-
- if ($pos == $len)
- {
- // ASCII strings return immediately
- return;
- }
-
- if (!isset($GLOBALS['utf_nfkc_qc']))
- {
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_nfkc_qc.' . $phpEx);
- }
-
- if (!isset($GLOBALS['utf_compatibility_decomp']))
- {
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_compatibility_decomp.' . $phpEx);
- }
-
- $str = utf_new_normalizer::recompose($str, $pos, $len, $GLOBALS['utf_nfkc_qc'], $GLOBALS['utf_compatibility_decomp']);
- }
-
- /**
- * Recompose a UTF string
- *
- * @param string $str Unchecked UTF string
- * @param integer $pos Position of the first UTF char (in bytes)
- * @param integer $len Length of the string (in bytes)
- * @param array &$qc Quick-check array, passed by reference but never modified
- * @param array &$decomp_map Decomposition mapping, passed by reference but never modified
- * @return string The string, validated and recomposed
- *
- * @access private
- */
- function recompose($str, $pos, $len, &$qc, &$decomp_map)
- {
- global $utf_canonical_comp;
-
- // Load the canonical composition table
- if (!isset($utf_canonical_comp))
- {
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_canonical_comp.' . $phpEx);
- }
-
- return utf_normalizer::recompose($str, $pos, $len, $qc, $decomp_map);
- }
-}
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 80fd40a944..bc8ea16338 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -74,7 +74,6 @@ require($phpbb_root_path . 'includes/functions.' . $phpEx);
require($phpbb_root_path . 'includes/functions_content.' . $phpEx);
require($phpbb_root_path . 'includes/constants.' . $phpEx);
-include($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);
require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
// Set PHP error handler to ours
@@ -88,23 +87,34 @@ $phpbb_container_builder->set_dump_container(false);
$phpbb_container = $phpbb_container_builder->get_container();
// set up caching
+/* @var $cache \phpbb\cache\service */
$cache = $phpbb_container->get('cache');
// Instantiate some basic classes
+/* @var $phpbb_dispatcher \phpbb\event\dispatcher */
$phpbb_dispatcher = $phpbb_container->get('dispatcher');
+
+/* @var $request \phpbb\request\request_interface */
$request = $phpbb_container->get('request');
+
+/* @var $user \phpbb\user */
$user = $phpbb_container->get('user');
+
+/* @var $auth \phpbb\auth\auth */
$auth = $phpbb_container->get('auth');
+
+/* @var $db \phpbb\db\driver\driver_interface */
$db = $phpbb_container->get('dbal.conn');
+
+/* @var $phpbb_log \phpbb\log\log_interface */
$phpbb_log = $phpbb_container->get('log');
// make sure request_var uses this request instance
request_var('', 0, false, false, $request); // "dependency injection" for a function
// Grab global variables, re-cache if necessary
+/* @var $config \phpbb\config\config */
$config = $phpbb_container->get('config');
-set_config(null, null, null, $config);
-set_config_count(null, null, null, $config);
if (!isset($config['version_update_from']))
{
@@ -121,6 +131,7 @@ if (file_exists($phpbb_root_path . 'includes/hooks/index.' . $phpEx))
require($phpbb_root_path . 'includes/hooks/index.' . $phpEx);
$phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('template', 'display')));
+ /* @var $phpbb_hook_finder \phpbb\hook\finder */
$phpbb_hook_finder = $phpbb_container->get('hook_finder');
foreach ($phpbb_hook_finder->find() as $hook)
{
@@ -173,11 +184,13 @@ define('IN_DB_UPDATE', true);
// End startup code
+/* @var $migrator \phpbb\db\migrator */
$migrator = $phpbb_container->get('migrator');
$migrator->set_output_handler(new \phpbb\db\log_wrapper_migrator_output_handler($user, new \phpbb\db\html_migrator_output_handler($user), $phpbb_root_path . 'store/migrations_' . time() . '.log'));
$migrator->create_migrations_table();
+/* @var $phpbb_extension_manager \phpbb\extension\manager */
$phpbb_extension_manager = $phpbb_container->get('ext.manager');
$migrations = $phpbb_extension_manager
@@ -231,7 +244,7 @@ while (!$migrator->finished())
if ($orig_version != $config['version'])
{
- add_log('admin', 'LOG_UPDATE_DATABASE', $orig_version, $config['version']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_UPDATE_DATABASE', false, array($orig_version, $config['version']));
}
echo $user->lang['DATABASE_UPDATE_COMPLETE'] . '<br />';
diff --git a/phpBB/install/index.php b/phpBB/install/index.php
index 5c16421499..495f49ee49 100644
--- a/phpBB/install/index.php
+++ b/phpBB/install/index.php
@@ -16,6 +16,7 @@
*/
define('IN_PHPBB', true);
define('IN_INSTALL', true);
+define('PHPBB_ENVIRONMENT', 'production');
/**#@-*/
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
@@ -102,7 +103,6 @@ phpbb_require_updated('includes/functions.' . $phpEx);
phpbb_require_updated('includes/functions_content.' . $phpEx, true);
phpbb_include_updated('includes/functions_admin.' . $phpEx);
-phpbb_include_updated('includes/utf/utf_normalizer.' . $phpEx);
phpbb_include_updated('includes/utf/utf_tools.' . $phpEx);
phpbb_require_updated('includes/functions_install.' . $phpEx);
@@ -137,12 +137,16 @@ $phpbb_container_builder->set_custom_parameters(array(
$phpbb_container = $phpbb_container_builder->get_container();
$phpbb_container->register('dbal.conn.driver')->setSynthetic(true);
+$phpbb_container->register('template.twig.environment')->setSynthetic(true);
$phpbb_container->compile();
$phpbb_class_loader->set_cache($phpbb_container->get('cache.driver'));
$phpbb_class_loader_ext->set_cache($phpbb_container->get('cache.driver'));
+/* @var $phpbb_dispatcher \phpbb\event\dispatcher */
$phpbb_dispatcher = $phpbb_container->get('dispatcher');
+
+/* @var $request \phpbb\request\request_interface */
$request = $phpbb_container->get('request');
// make sure request_var uses this request instance
@@ -249,6 +253,7 @@ if (file_exists($phpbb_root_path . 'includes/hooks/index.' . $phpEx))
require($phpbb_root_path . 'includes/hooks/index.' . $phpEx);
$phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('template', 'display')));
+ /* @var $phpbb_hook_finder \phpbb\hook\finder */
$phpbb_hook_finder = $phpbb_container->get('hook_finder');
foreach ($phpbb_hook_finder->find() as $hook)
{
@@ -265,10 +270,36 @@ $config = new \phpbb\config\config(array(
'load_tplcompile' => '1'
));
+/* @var $symfony_request \phpbb\symfony_request */
$symfony_request = $phpbb_container->get('symfony_request');
+
+/* @var $phpbb_filesystem \phpbb\filesystem */
$phpbb_filesystem = $phpbb_container->get('filesystem');
+
+/* @var $phpbb_path_helper \phpbb\path_helper */
$phpbb_path_helper = $phpbb_container->get('path_helper');
-$template = new \phpbb\template\twig\twig($phpbb_path_helper, $config, $user, new \phpbb\template\context());
+$cache_path = $phpbb_root_path . 'cache/';
+
+$twig_environment = new \phpbb\template\twig\environment(
+ $config,
+ $phpbb_path_helper,
+ $phpbb_container,
+ $cache_path,
+ null,
+ $phpbb_container->get('template.twig.loader')
+);
+
+$phpbb_container->set('template.twig.environment', $twig_environment);
+$template = new \phpbb\template\twig\twig(
+ $phpbb_path_helper,
+ $config,
+ $user,
+ new \phpbb\template\context(),
+ $twig_environment,
+ $cache_path,
+ array($phpbb_container->get('template.twig.extensions.phpbb'))
+);
+
$paths = array($phpbb_root_path . 'install/update/new/adm/style', $phpbb_admin_path . 'style');
$paths = array_filter($paths, 'is_dir');
$template->set_custom_style(array(
diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php
index 6a892a7373..9f6116ed12 100644
--- a/phpBB/install/install_convert.php
+++ b/phpBB/install/install_convert.php
@@ -131,6 +131,7 @@ class install_convert extends module
$phpbb_container = $phpbb_container_builder->get_container();
// Create cache
+ /* @var $cache \phpbb\cache\service */
$cache = $phpbb_container->get('cache');
switch ($sub)
@@ -149,8 +150,6 @@ class install_convert extends module
// We need to fill the config to let internal functions correctly work
$config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE);
- set_config(null, null, null, $config);
- set_config_count(null, null, null, $config);
// Detect if there is already a conversion in progress at this point and offer to resume
// It's quite possible that the user will get disconnected during a large conversion so they need to be able to resume it
@@ -390,8 +389,6 @@ class install_convert extends module
// We need to fill the config to let internal functions correctly work
$config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE);
- set_config(null, null, null, $config);
- set_config_count(null, null, null, $config);
$convertor_tag = request_var('tag', '');
@@ -533,24 +530,27 @@ class install_convert extends module
if (!sizeof($error))
{
// Save convertor Status
- set_config('convert_progress', serialize(array(
+ $config->set('convert_progress', serialize(array(
'step' => '',
'table_prefix' => $src_table_prefix,
'tag' => $convertor_tag,
- )), true);
- set_config('convert_db_server', serialize(array(
+ )), false);
+ $config->set('convert_db_server', serialize(array(
'dbms' => $src_dbms,
'dbhost' => $src_dbhost,
'dbport' => $src_dbport,
'dbname' => $src_dbname,
- )), true);
- set_config('convert_db_user', serialize(array(
+ )), false);
+ $config->set('convert_db_user', serialize(array(
'dbuser' => $src_dbuser,
'dbpasswd' => $src_dbpasswd,
- )), true);
+ )), false);
// Save options
- set_config('convert_options', serialize(array('forum_path' => './../' . $forum_path, 'refresh' => $refresh)), true);
+ $config->set('convert_options', serialize(array(
+ 'forum_path' => './../' . $forum_path,
+ 'refresh' => $refresh
+ )), false);
$template->assign_block_vars('checks', array(
'TITLE' => $lang['VERIFY_OPTIONS'],
@@ -634,8 +634,6 @@ class install_convert extends module
// We need to fill the config to let internal functions correctly work
$config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE);
- set_config(null, null, null, $config);
- set_config_count(null, null, null, $config);
// Override a couple of config variables for the duration
$config['max_quote_depth'] = 0;
@@ -787,7 +785,7 @@ class install_convert extends module
if (!class_exists($search_type))
{
$search_type = '\phpbb\search\fulltext_native';
- set_config('search_type', $search_type);
+ $config->set('search_type', $search_type);
}
if (!class_exists($search_type))
@@ -1560,26 +1558,26 @@ class install_convert extends module
*/
function save_convert_progress($step)
{
- global $convert, $language;
+ global $config, $convert, $language;
// Save convertor Status
- set_config('convert_progress', serialize(array(
+ $config->set('convert_progress', serialize(array(
'step' => $step,
'table_prefix' => $convert->src_table_prefix,
'tag' => $convert->convertor_tag,
- )), true);
+ )), false);
- set_config('convert_db_server', serialize(array(
+ $config->set('convert_db_server', serialize(array(
'dbms' => $convert->src_dbms,
'dbhost' => $convert->src_dbhost,
'dbport' => $convert->src_dbport,
'dbname' => $convert->src_dbname,
- )), true);
+ )), false);
- set_config('convert_db_user', serialize(array(
+ $config->set('convert_db_user', serialize(array(
'dbuser' => $convert->src_dbuser,
'dbpasswd' => $convert->src_dbpasswd,
- )), true);
+ )), false);
return $this->p_master->module_url . "?mode={$this->mode}&amp;sub=in_progress&amp;tag={$convert->convertor_tag}$step&amp;language=$language";
}
@@ -1603,8 +1601,7 @@ class install_convert extends module
phpbb_cache_moderators($db, $cache, $auth);
// And finally, add a note to the log
- $phpbb_log = $phpbb_container->get('log');
- add_log('admin', 'LOG_INSTALL_CONVERTED', $convert->convertor_data['forum_name'], $config['version']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_INSTALL_CONVERTED', false, array($convert->convertor_data['forum_name'], $config['version']));
$url = $this->p_master->module_url . "?mode={$this->mode}&amp;sub=final&amp;language=$language";
@@ -1759,7 +1756,7 @@ class install_convert extends module
if (!isset($config['board_startdate']) || ($row['board_startdate'] < $config['board_startdate'] && $row['board_startdate'] > 0))
{
- set_config('board_startdate', $row['board_startdate']);
+ $config->set('board_startdate', $row['board_startdate']);
$db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_regdate = ' . $row['board_startdate'] . ' WHERE user_id = ' . ANONYMOUS);
}
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index 3a6858a254..536b7142d5 100644
--- a/phpBB/install/install_install.php
+++ b/phpBB/install/install_install.php
@@ -108,7 +108,10 @@ class install_install extends module
$phpbb_container = $phpbb_container_builder->get_container();
// Sets the global variables
+ /* @var $cache \phpbb\cache\service */
$cache = $phpbb_container->get('cache');
+
+ /* @var $phpbb_log \phpbb\log\log_interface */
$phpbb_log = $phpbb_container->get('log');
$this->build_search_index($mode, $sub);
@@ -1197,7 +1200,7 @@ class install_install extends module
->get_classes();
$sqlite_db = new \phpbb\db\driver\sqlite();
- $schema_generator = new \phpbb\db\migration\schema_generator($classes, new \phpbb\config\config(array()), $sqlite_db, new \phpbb\db\tools($sqlite_db, true), $phpbb_root_path, $phpEx, $table_prefix);
+ $schema_generator = new \phpbb\db\migration\schema_generator($classes, new \phpbb\config\config(array()), $sqlite_db, new \phpbb\db\tools\tools($sqlite_db, true), $phpbb_root_path, $phpEx, $table_prefix);
$db_table_schema = $schema_generator->get_schema();
}
@@ -1209,7 +1212,7 @@ class install_install extends module
define('CONFIG_TABLE', $data['table_prefix'] . 'config');
}
- $db_tools = new \phpbb\db\tools($db);
+ $db_tools = new \phpbb\db\tools\tools($db);
foreach ($db_table_schema as $table_name => $table_data)
{
$db_tools->sql_create_table(
@@ -1490,8 +1493,6 @@ class install_install extends module
// We need to fill the config to let internal functions correctly work
$config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE);
- set_config(null, null, null, $config);
- set_config_count(null, null, null, $config);
$error = false;
$search = new \phpbb\search\fulltext_native($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user);
@@ -1517,6 +1518,7 @@ class install_install extends module
// modules require an extension manager
if (empty($phpbb_extension_manager))
{
+ /* @var $phpbb_extension_manager \phpbb\extension\manager */
$phpbb_extension_manager = $phpbb_container->get('ext.manager');
}
@@ -1906,8 +1908,6 @@ class install_install extends module
// We need to fill the config to let internal functions correctly work
$config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE);
- set_config(null, null, null, $config);
- set_config_count(null, null, null, $config);
$sql = 'SELECT group_id
FROM ' . GROUPS_TABLE . "
@@ -1971,7 +1971,7 @@ class install_install extends module
*/
function email_admin($mode, $sub)
{
- global $auth, $config, $db, $lang, $template, $user, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $auth, $config, $db, $lang, $template, $user, $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_log;
$this->page_title = $lang['STAGE_FINAL'];
@@ -1980,8 +1980,6 @@ class install_install extends module
// We need to fill the config to let internal functions correctly work
$config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE);
- set_config(null, null, null, $config);
- set_config_count(null, null, null, $config);
$user->session_begin();
$auth->login($data['admin_name'], $data['admin_pass1'], false, true, true);
@@ -2012,7 +2010,7 @@ class install_install extends module
}
// And finally, add a note to the log
- add_log('admin', 'LOG_INSTALL_INSTALLED', $config['version']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_INSTALL_INSTALLED', false, array($config['version']));
$template->assign_vars(array(
'TITLE' => $lang['INSTALL_CONGRATS'],
@@ -2028,12 +2026,12 @@ class install_install extends module
*/
function disable_avatars_if_unwritable()
{
- global $phpbb_root_path;
+ global $config, $phpbb_root_path;
if (!phpbb_is_writable($phpbb_root_path . 'images/avatars/upload/'))
{
- set_config('allow_avatar', 0);
- set_config('allow_avatar_upload', 0);
+ $config->set('allow_avatar', 0);
+ $config->set('allow_avatar_upload', 0);
}
}
diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php
index 82ca0fc18d..cb00895a4b 100644
--- a/phpBB/install/install_update.php
+++ b/phpBB/install/install_update.php
@@ -84,6 +84,7 @@ class install_update extends module
$phpbb_container = $phpbb_container_builder->get_container();
// Writes into global $cache
+ /* @var $cache \phpbb\cache\service */
$cache = $phpbb_container->get('cache');
$this->tpl_name = 'install_update';
@@ -114,8 +115,6 @@ class install_update extends module
// We need to fill the config to let internal functions correctly work
$config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE);
- set_config(null, null, null, $config);
- set_config_count(null, null, null, $config);
// Force template recompile
$config['load_tplcompile'] = 1;
@@ -161,6 +160,7 @@ class install_update extends module
));
// Get current and latest version
+ /* @var $version_helper \phpbb\version_helper */
$version_helper = $phpbb_container->get('version_helper');
try
{
@@ -234,7 +234,7 @@ class install_update extends module
// Fill DB version
if (empty($config['dbms_version']))
{
- set_config('dbms_version', $db->sql_server_info(true));
+ $config->set('dbms_version', $db->sql_server_info(true));
}
if ($this->test_update === false)
@@ -519,6 +519,8 @@ class install_update extends module
if ($all_up_to_date)
{
global $phpbb_container;
+
+ /* @var $phpbb_log \phpbb\log\log_interface */
$phpbb_log = $phpbb_container->get('log');
// Add database update to log
@@ -1689,7 +1691,7 @@ class install_update extends module
// Get custom installed styles...
$sql = 'SELECT style_name, style_path
FROM ' . STYLES_TABLE . "
- WHERE LOWER(style_name) NOT IN ('subsilver2', 'prosilver')";
+ WHERE LOWER(style_name) NOT IN ('prosilver')";
$result = $db->sql_query($sql);
$templates = array();
diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index a39bb365d6..1f856f016c 100644
--- a/phpBB/install/schemas/schema_data.sql
+++ b/phpBB/install/schemas/schema_data.sql
@@ -273,7 +273,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('tpl_allow_php', '0
INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_icons_path', 'images/upload_icons');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_path', 'files');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('use_system_cron', '0');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.1.4-dev');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.2.0-a1-dev');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_expire_days', '90');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_gc', '14400');