diff options
author | Máté Bartus <mate.bartus@gmail.com> | 2016-04-06 21:01:41 +0200 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2019-05-06 21:26:55 +0200 |
commit | 7a831c3e2844c94feb5fea2a4710816c5024623a (patch) | |
tree | 23d6ec523133fb34bbd375411112af10f2fba8db | |
parent | 61bdccbfd804c6638e977d250f6e9a0f30aa5f98 (diff) | |
download | forums-7a831c3e2844c94feb5fea2a4710816c5024623a.tar forums-7a831c3e2844c94feb5fea2a4710816c5024623a.tar.gz forums-7a831c3e2844c94feb5fea2a4710816c5024623a.tar.bz2 forums-7a831c3e2844c94feb5fea2a4710816c5024623a.tar.xz forums-7a831c3e2844c94feb5fea2a4710816c5024623a.zip |
[ticket/14548] Move deprecated globals and functions
PHPBB3-14584
-rw-r--r-- | phpBB/includes/compatibility_globals.php | 7 | ||||
-rw-r--r-- | phpBB/includes/constants.php | 3 | ||||
-rw-r--r-- | phpBB/includes/functions.php | 12 | ||||
-rw-r--r-- | phpBB/includes/functions_admin.php | 39 | ||||
-rw-r--r-- | phpBB/includes/functions_compatibility.php | 90 | ||||
-rw-r--r-- | phpBB/includes/functions_display.php | 12 | ||||
-rw-r--r-- | phpBB/includes/functions_posting.php | 28 |
7 files changed, 97 insertions, 94 deletions
diff --git a/phpBB/includes/compatibility_globals.php b/phpBB/includes/compatibility_globals.php index ad394e3782..223c8a0120 100644 --- a/phpBB/includes/compatibility_globals.php +++ b/phpBB/includes/compatibility_globals.php @@ -18,6 +18,13 @@ if (!defined('IN_PHPBB')) exit; } +// +// Deprecated globals +// +define('ATTACHMENT_CATEGORY_WM', 2); // Windows Media Files - Streaming - @deprecated 3.2 +define('ATTACHMENT_CATEGORY_RM', 3); // Real Media Files - Streaming - @deprecated 3.2 +define('ATTACHMENT_CATEGORY_QUICKTIME', 6); // Quicktime/Mov files - @deprecated 3.2 + /** * Sets compatibility globals in the global scope * diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index 89d056f2e1..041f4c5022 100644 --- a/phpBB/includes/constants.php +++ b/phpBB/includes/constants.php @@ -171,11 +171,8 @@ define('CONFIRM_REPORT', 4); // Categories - Attachments define('ATTACHMENT_CATEGORY_NONE', 0); define('ATTACHMENT_CATEGORY_IMAGE', 1); // Inline Images -define('ATTACHMENT_CATEGORY_WM', 2); // Windows Media Files - Streaming - @deprecated 3.2 -define('ATTACHMENT_CATEGORY_RM', 3); // Real Media Files - Streaming - @deprecated 3.2 define('ATTACHMENT_CATEGORY_THUMB', 4); // Not used within the database, only while displaying posts define('ATTACHMENT_CATEGORY_FLASH', 5); // Flash/SWF files -define('ATTACHMENT_CATEGORY_QUICKTIME', 6); // Quicktime/Mov files - @deprecated 3.2 // BBCode UID length define('BBCODE_UID_LEN', 8); diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 5234c3472d..44c51eb1ad 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -52,18 +52,6 @@ function phpbb_load_extensions_autoloaders($phpbb_root_path) } /** -* Casts a variable to the given type. -* -* @deprecated -*/ -function set_var(&$result, $var, $type, $multibyte = false) -{ - // no need for dependency injection here, if you have the object, call the method yourself! - $type_cast_helper = new \phpbb\request\type_cast_helper(); - $type_cast_helper->set_var($result, $var, $type, $multibyte); -} - -/** * Generates an alphanumeric random string of given length * * @param int $num_chars Length of random string, defaults to 8. diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index c19d48b0be..1f3fe1c8e8 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -1161,28 +1161,6 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = } /** -* Delete Attachments -* -* @deprecated 3.2.0-a1 (To be removed: 3.4.0) -* -* @param string $mode can be: post|message|topic|attach|user -* @param mixed $ids can be: post_ids, message_ids, topic_ids, attach_ids, user_ids -* @param bool $resync set this to false if you are deleting posts or topics -*/ -function delete_attachments($mode, $ids, $resync = true) -{ - global $phpbb_container; - - /** @var \phpbb\attachment\manager $attachment_manager */ - $attachment_manager = $phpbb_container->get('attachment.manager'); - $num_deleted = $attachment_manager->delete($mode, $ids, $resync); - - unset($attachment_manager); - - return $num_deleted; -} - -/** * Deletes shadow topics pointing to a specified forum. * * @param int $forum_id The forum id @@ -1294,23 +1272,6 @@ function update_posted_info(&$topic_ids) } /** -* Delete attached file -* -* @deprecated 3.2.0-a1 (To be removed: 3.4.0) -*/ -function phpbb_unlink($filename, $mode = 'file', $entry_removed = false) -{ - global $phpbb_container; - - /** @var \phpbb\attachment\manager $attachment_manager */ - $attachment_manager = $phpbb_container->get('attachment.manager'); - $unlink = $attachment_manager->unlink($filename, $mode, $entry_removed); - unset($attachment_manager); - - return $unlink; -} - -/** * All-encompasing sync function * * Exaples: diff --git a/phpBB/includes/functions_compatibility.php b/phpBB/includes/functions_compatibility.php index e95fa40a58..51d9402558 100644 --- a/phpBB/includes/functions_compatibility.php +++ b/phpBB/includes/functions_compatibility.php @@ -511,3 +511,93 @@ function phpbb_pcre_utf8_support() { return true; } + +/** + * Casts a variable to the given type. + * + * @deprecated 3.3.0-dev (To be removed 3.4.0) + */ +function set_var(&$result, $var, $type, $multibyte = false) +{ + // no need for dependency injection here, if you have the object, call the method yourself! + $type_cast_helper = new \phpbb\request\type_cast_helper(); + $type_cast_helper->set_var($result, $var, $type, $multibyte); +} + +/** + * Delete Attachments + * + * @deprecated 3.2.0-a1 (To be removed: 3.4.0) + * + * @param string $mode can be: post|message|topic|attach|user + * @param mixed $ids can be: post_ids, message_ids, topic_ids, attach_ids, user_ids + * @param bool $resync set this to false if you are deleting posts or topics + */ +function delete_attachments($mode, $ids, $resync = true) +{ + global $phpbb_container; + + /** @var \phpbb\attachment\manager $attachment_manager */ + $attachment_manager = $phpbb_container->get('attachment.manager'); + $num_deleted = $attachment_manager->delete($mode, $ids, $resync); + + unset($attachment_manager); + + return $num_deleted; +} + +/** + * Delete attached file + * + * @deprecated 3.2.0-a1 (To be removed: 3.4.0) + */ +function phpbb_unlink($filename, $mode = 'file', $entry_removed = false) +{ + global $phpbb_container; + + /** @var \phpbb\attachment\manager $attachment_manager */ + $attachment_manager = $phpbb_container->get('attachment.manager'); + $unlink = $attachment_manager->unlink($filename, $mode, $entry_removed); + unset($attachment_manager); + + return $unlink; +} + +/** + * Display reasons + * + * @deprecated 3.2.0-dev (To be removed: 3.4.0) + */ +function display_reasons($reason_id = 0) +{ + global $phpbb_container; + + $phpbb_container->get('phpbb.report.report_reason_list_provider')->display_reasons($reason_id); +} + +/** + * Upload Attachment - filedata is generated here + * Uses upload class + * + * @deprecated 3.2.0-a1 (To be removed: 3.4.0) + * + * @param string $form_name The form name of the file upload input + * @param int $forum_id The id of the forum + * @param bool $local Whether the file is local or not + * @param string $local_storage The path to the local file + * @param bool $is_message Whether it is a PM or not + * @param array $local_filedata A filespec object created for the local file + * + * @return array File data array + */ +function upload_attachment($form_name, $forum_id, $local = false, $local_storage = '', $is_message = false, $local_filedata = false) +{ + global $phpbb_container; + + /** @var \phpbb\attachment\manager $attachment_manager */ + $attachment_manager = $phpbb_container->get('attachment.manager'); + $file = $attachment_manager->upload($form_name, $forum_id, $local, $local_storage, $is_message, $local_filedata); + unset($attachment_manager); + + return $file; +} diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 792467019f..509c618b69 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -1149,18 +1149,6 @@ function display_custom_bbcodes() } /** -* Display reasons -* -* @deprecated 3.2.0-dev -*/ -function display_reasons($reason_id = 0) -{ - global $phpbb_container; - - $phpbb_container->get('phpbb.report.report_reason_list_provider')->display_reasons($reason_id); -} - -/** * Display user activity (action forum/topic) */ function display_user_activity(&$userdata_ary) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 3640f543d9..e2ab717217 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -397,34 +397,6 @@ function posting_gen_topic_types($forum_id, $cur_topic_type = POST_NORMAL) // // Attachment related functions // - -/** -* Upload Attachment - filedata is generated here -* Uses upload class -* -* @deprecated 3.2.0-a1 (To be removed: 3.4.0) -* -* @param string $form_name The form name of the file upload input -* @param int $forum_id The id of the forum -* @param bool $local Whether the file is local or not -* @param string $local_storage The path to the local file -* @param bool $is_message Whether it is a PM or not -* @param array $local_filedata A filespec object created for the local file -* -* @return array File data array -*/ -function upload_attachment($form_name, $forum_id, $local = false, $local_storage = '', $is_message = false, $local_filedata = false) -{ - global $phpbb_container; - - /** @var \phpbb\attachment\manager $attachment_manager */ - $attachment_manager = $phpbb_container->get('attachment.manager'); - $file = $attachment_manager->upload($form_name, $forum_id, $local, $local_storage, $is_message, $local_filedata); - unset($attachment_manager); - - return $file; -} - /** * Calculate the needed size for Thumbnail */ |