From af827bf2b4d35c7a55ee5888448376555ed7929c Mon Sep 17 00:00:00 2001 From: Nicofuma Date: Wed, 23 Apr 2014 00:58:08 +0200 Subject: [PATCH] [ticket/12199] Move deprecated functions to functions_compatibility.php Currently 13 functions are marked as deprecated: functions.php: function set_var() function request_var() function set_config() function set_config_count() function tz_select() function add_log() functions_admin: function cache_moderators() function update_foes() functions_compatibility: function get_user_avatar() function phpbb_hash() function phpbb_check_hash() function phpbb_clean_path() functions_install: function get_tables() 8 of them are still used in the core: add_log Used in many places (~198 calls) get_tables Used in install\install_convert::get_convert_settings and functions_install.php\connect_check_db get_user_avatar Used in phpbb\user_loader:get_avatar phpbb_hash Used in phpbb\db\migration\data\v30x\release_3_0_5_rc1 request_var Used quite everywhere (~997 calls) set_config Used in many places (~129 calls) set_config_count Used in a few places (~37 calls) set_var Used by phpbb_http_login and phpbb\auth\provider\apache::autologin PHPBB3-12199 --- phpBB/includes/functions.php | 18 --------- phpBB/includes/functions_admin.php | 28 ------------- phpBB/includes/functions_compatibility.php | 46 ++++++++++++++++++++++ 3 files changed, 46 insertions(+), 46 deletions(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 0cb88cd8ee..0d14f5ae67 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1004,24 +1004,6 @@ function phpbb_get_timezone_identifiers($selected_timezone) return $timezones; } -/** -* Pick a timezone -* -* @param string $default A timezone to select -* @param boolean $truncate Shall we truncate the options text -* -* @return string Returns the options for timezone selector only -* -* @deprecated -*/ -function tz_select($default = '', $truncate = false) -{ - global $user; - - $timezone_select = phpbb_timezone_select($user, $default, $truncate); - return $timezone_select['tz_select']; -} - /** * Options to pick a timezone and date/time * diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index d72f89b6ac..a343da7a7c 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -2580,20 +2580,6 @@ function phpbb_cache_moderators($db, $cache, $auth) $db->sql_multi_insert(MODERATOR_CACHE_TABLE, $sql_ary); } -/** -* Cache moderators. Called whenever permissions are changed -* via admin_permissions. Changes of usernames and group names -* must be carried through for the moderators table. -* -* @deprecated 3.1 -* @return null -*/ -function cache_moderators() -{ - global $db, $cache, $auth; - return phpbb_cache_moderators($db, $cache, $auth); -} - /** * View log * @@ -2743,20 +2729,6 @@ function phpbb_update_foes($db, $auth, $group_id = false, $user_id = false) unset($perms); } -/** -* Removes moderators and administrators from foe lists. -* -* @deprecated 3.1 -* @param array|bool $group_id If an array, remove all members of this group from foe lists, or false to ignore -* @param array|bool $user_id If an array, remove this user from foe lists, or false to ignore -* @return null -*/ -function update_foes($group_id = false, $user_id = false) -{ - global $db, $auth; - return phpbb_update_foes($db, $auth, $group_id, $user_id); -} - /** * Lists inactive users */ diff --git a/phpBB/includes/functions_compatibility.php b/phpBB/includes/functions_compatibility.php index 164dd4cb99..c2db53f86c 100644 --- a/phpBB/includes/functions_compatibility.php +++ b/phpBB/includes/functions_compatibility.php @@ -116,3 +116,49 @@ function phpbb_clean_path($path) return $phpbb_path_helper->clean_path($path); } + +/** +* Pick a timezone +* +* @param string $default A timezone to select +* @param boolean $truncate Shall we truncate the options text +* +* @return string Returns the options for timezone selector only +* +* @deprecated +*/ +function tz_select($default = '', $truncate = false) +{ + global $user; + + $timezone_select = phpbb_timezone_select($user, $default, $truncate); + return $timezone_select['tz_select']; +} + +/** +* Cache moderators. Called whenever permissions are changed +* via admin_permissions. Changes of usernames and group names +* must be carried through for the moderators table. +* +* @deprecated 3.1 +* @return null +*/ +function cache_moderators() +{ + global $db, $cache, $auth; + return phpbb_cache_moderators($db, $cache, $auth); +} + +/** +* Removes moderators and administrators from foe lists. +* +* @deprecated 3.1 +* @param array|bool $group_id If an array, remove all members of this group from foe lists, or false to ignore +* @param array|bool $user_id If an array, remove this user from foe lists, or false to ignore +* @return null +*/ +function update_foes($group_id = false, $user_id = false) +{ + global $db, $auth; + return phpbb_update_foes($db, $auth, $group_id, $user_id); +}