From 06d226f292ecad19a646b302dfe28c00d425b1bf Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 11 Jul 2024 21:43:46 +0200 Subject: [PATCH] [ticket/12479] Remove set_config and set_config_count PHPBB-12479 --- phpBB/includes/compatibility_globals.php | 2 - phpBB/includes/functions_compatibility.php | 60 ------------------- .../generate_text_for_display_test.php | 1 - .../generate_text_for_storage_test.php | 1 - 4 files changed, 64 deletions(-) diff --git a/phpBB/includes/compatibility_globals.php b/phpBB/includes/compatibility_globals.php index df152c81ab..f1f5dd8321 100644 --- a/phpBB/includes/compatibility_globals.php +++ b/phpBB/includes/compatibility_globals.php @@ -67,8 +67,6 @@ function register_compatibility_globals() // Grab global variables, re-cache if necessary /* @var $config phpbb\config\db */ $config = $phpbb_container->get('config'); - set_config('', '', false, $config); - set_config_count('', 0, false, $config); /* @var $phpbb_log \phpbb\log\log_interface */ $phpbb_log = $phpbb_container->get('log'); diff --git a/phpBB/includes/functions_compatibility.php b/phpBB/includes/functions_compatibility.php index a6b5d26d3f..13563d79ef 100644 --- a/phpBB/includes/functions_compatibility.php +++ b/phpBB/includes/functions_compatibility.php @@ -19,66 +19,6 @@ if (!defined('IN_PHPBB')) exit; } -/** - * Sets a configuration option's value. - * - * Please note that this function does not update the is_dynamic value for - * an already existing config option. - * - * @param string $config_name The configuration option's name - * @param string $config_value New configuration value - * @param bool $is_dynamic Whether this variable should be cached (false) or - * if it changes too frequently (true) to be - * efficiently cached. - * - * @return void - * - * @deprecated 3.1.0 (To be removed: 4.0.0) - */ -function set_config($config_name, $config_value, $is_dynamic = false, \phpbb\config\config $set_config = null) -{ - static $config = null; - - if ($set_config !== null) - { - $config = $set_config; - - if (empty($config_name)) - { - return; - } - } - - $config->set($config_name, $config_value, !$is_dynamic); -} - -/** - * Increments an integer config value directly in the database. - * - * @param string $config_name The configuration option's name - * @param int $increment Amount to increment by - * @param bool $is_dynamic Whether this variable should be cached (false) or - * if it changes too frequently (true) to be - * efficiently cached. - * - * @return void - * - * @deprecated 3.1.0 (To be removed: 4.0.0) - */ -function set_config_count($config_name, $increment, $is_dynamic = false, \phpbb\config\config $set_config = null) -{ - static $config = null; - if ($set_config !== null) - { - $config = $set_config; - if (empty($config_name)) - { - return; - } - } - $config->increment($config_name, $increment, !$is_dynamic); -} - /** * Wrapper function of \phpbb\request\request::variable which exists for backwards compatability. * See {@link \phpbb\request\request_interface::variable \phpbb\request\request_interface::variable} for diff --git a/tests/text_processing/generate_text_for_display_test.php b/tests/text_processing/generate_text_for_display_test.php index 9a909a007c..7d96152c21 100644 --- a/tests/text_processing/generate_text_for_display_test.php +++ b/tests/text_processing/generate_text_for_display_test.php @@ -21,7 +21,6 @@ class phpbb_text_processing_generate_text_for_display_test extends phpbb_test_ca $phpbb_dispatcher = new phpbb_mock_event_dispatcher; $config = new \phpbb\config\config(array()); - set_config(null, null, null, $config); } /** diff --git a/tests/text_processing/generate_text_for_storage_test.php b/tests/text_processing/generate_text_for_storage_test.php index c47c9b9f5e..86c257a9f6 100644 --- a/tests/text_processing/generate_text_for_storage_test.php +++ b/tests/text_processing/generate_text_for_storage_test.php @@ -20,7 +20,6 @@ class phpbb_text_processing_generate_text_for_storage_test extends phpbb_test_ca parent::setUp(); $config = new \phpbb\config\config(array()); - set_config(null, null, null, $config); $phpbb_container = new phpbb_mock_container_builder; $phpbb_container->set('config', $config);