mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-13 04:04:12 +02:00
[ticket/13494] Update calls to set_config()
PHPBB3-13494
This commit is contained in:
@@ -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
|
||||
|
@@ -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']);
|
||||
$config->set('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']);
|
||||
$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']);
|
||||
|
||||
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('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']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -115,7 +115,6 @@ request_var('', 0, false, false, $request); // "dependency injection" for a func
|
||||
// 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']))
|
||||
|
@@ -150,7 +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
|
||||
@@ -391,7 +390,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', '');
|
||||
@@ -534,24 +532,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'],
|
||||
@@ -635,7 +636,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
|
||||
@@ -788,7 +788,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))
|
||||
@@ -1561,26 +1561,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}&sub=in_progress&tag={$convert->convertor_tag}$step&language=$language";
|
||||
}
|
||||
@@ -1759,7 +1759,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);
|
||||
}
|
||||
|
||||
|
@@ -1493,7 +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;
|
||||
@@ -1910,7 +1909,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
|
||||
@@ -1984,7 +1982,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();
|
||||
@@ -2032,12 +2029,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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -115,7 +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
|
||||
@@ -236,7 +235,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)
|
||||
|
Reference in New Issue
Block a user