From 21d35067b90c05356b3442300cbfb4948f6b9689 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Fri, 6 May 2011 21:09:34 +0000 Subject: [PATCH] Kill some more long deprecated unused functions Add more @deprecated since where appropriate --- includes/Revision.php | 2 +- includes/SiteStats.php | 8 ------ includes/WikiError.php | 8 ++++++ includes/db/Database.php | 24 +++-------------- includes/filerepo/File.php | 43 +------------------------------ includes/media/Exif.php | 4 +++ includes/media/FormatMetadata.php | 2 +- includes/parser/Parser.php | 9 ------- includes/parser/ParserOptions.php | 2 +- languages/Language.php | 9 ------- 10 files changed, 19 insertions(+), 92 deletions(-) diff --git a/includes/Revision.php b/includes/Revision.php index 71163e16ef..5fff018e69 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -602,7 +602,7 @@ class Revision { /** * Alias for getText(Revision::FOR_THIS_USER) * - * @deprecated + * @deprecated since 1.17 * @return String */ public function revText() { diff --git a/includes/SiteStats.php b/includes/SiteStats.php index 5a0d7a5d7d..9914a3b343 100644 --- a/includes/SiteStats.php +++ b/includes/SiteStats.php @@ -99,14 +99,6 @@ class SiteStats { return self::$row->ss_images; } - /** - * @deprecated Use self::numberingroup('sysop') instead - */ - static function admins() { - wfDeprecated(__METHOD__); - return self::numberingroup( 'sysop' ); - } - /** * Find the number of users in a given user group. * @param $group String: name of group diff --git a/includes/WikiError.php b/includes/WikiError.php index 6c7406a445..a634dff646 100644 --- a/includes/WikiError.php +++ b/includes/WikiError.php @@ -31,6 +31,8 @@ class WikiError { /** * @param $message string + * + * @deprecated since 1.17 */ function __construct( $message ) { wfDeprecated( __METHOD__ ); @@ -59,6 +61,8 @@ class WikiError { * * @param $object mixed * @return bool + * + * @deprecated since 1.17 */ public static function isError( $object ) { wfDeprecated( __METHOD__ ); @@ -80,6 +84,8 @@ class WikiErrorMsg extends WikiError { /** * @param $message String: wiki message name * @param ... parameters to pass to wfMsg() + * + * @deprecated since 1.17 */ function __construct( $message/*, ... */ ) { wfDeprecated( __METHOD__ ); @@ -110,6 +116,8 @@ class WikiXmlError extends WikiError { * @param $message string * @param $context * @param $offset Int + * + * @deprecated since 1.17 */ function __construct( $parser, $message = 'XML parsing error', $context = null, $offset = 0 ) { wfDeprecated( __METHOD__ ); diff --git a/includes/db/Database.php b/includes/db/Database.php index 6ef582baa5..7ae7a34b13 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -521,7 +521,7 @@ abstract class DatabaseBase implements DatabaseType { /** * Same as new DatabaseMysql( ... ), kept for backward compatibility - * @deprecated + * @deprecated since 1.17 */ static function newFromParams( $server, $user, $password, $dbName, $flags = 0 ) { wfDeprecated( __METHOD__ ); @@ -1769,7 +1769,7 @@ abstract class DatabaseBase implements DatabaseType { * Backwards compatibility, identifier quoting originated in DatabasePostgres * which used quote_ident which does not follow our naming conventions * was renamed to addIdentifierQuotes. - * @deprecated use addIdentifierQuotes + * @deprecated since 1.18 use addIdentifierQuotes */ function quote_ident( $s ) { wfDeprecated( __METHOD__ ); @@ -1780,7 +1780,7 @@ abstract class DatabaseBase implements DatabaseType { * Escape string for safe LIKE usage. * WARNING: you should almost never use this function directly, * instead use buildLike() that escapes everything automatically - * Deprecated in 1.17, warnings in 1.17, removed in ??? + * @deprecated since 1.17, warnings in 1.17, removed in ??? */ public function escapeLike( $s ) { wfDeprecated( __METHOD__ ); @@ -2306,24 +2306,6 @@ abstract class DatabaseBase implements DatabaseType { } } - /** - * Begin a transaction, committing any previously open transaction - * @deprecated use begin() - */ - function immediateBegin( $fname = 'DatabaseBase::immediateBegin' ) { - wfDeprecated( __METHOD__ ); - $this->begin(); - } - - /** - * Commit transaction, if one is open - * @deprecated use commit() - */ - function immediateCommit( $fname = 'DatabaseBase::immediateCommit' ) { - wfDeprecated( __METHOD__ ); - $this->commit(); - } - /** * Creates a new table with structure copied from existing table * Note that unlike most database abstraction functions, this function does not diff --git a/includes/filerepo/File.php b/includes/filerepo/File.php index 5d51e4c589..6f9c6397df 100644 --- a/includes/filerepo/File.php +++ b/includes/filerepo/File.php @@ -242,7 +242,7 @@ abstract class File { /** * Alias for getPath() * - * @deprecated Use getPath(). + * @deprecated since 1.18 Use getPath(). */ public function getFullPath() { wfDeprecated( __METHOD__ ); @@ -905,47 +905,6 @@ abstract class File { $this->readOnlyError(); } - /** - * Get an array of Title objects which are articles which use this file - * Also adds their IDs to the link cache - * - * This is mostly copied from Title::getLinksTo() - * - * @deprecated Use HTMLCacheUpdate, this function uses too much memory - */ - function getLinksTo( $options = array() ) { - wfDeprecated( __METHOD__ ); - wfProfileIn( __METHOD__ ); - - // Note: use local DB not repo DB, we want to know local links - if ( count( $options ) > 0 ) { - $db = wfGetDB( DB_MASTER ); - } else { - $db = wfGetDB( DB_SLAVE ); - } - $linkCache = LinkCache::singleton(); - - $encName = $db->addQuotes( $this->getName() ); - $res = $db->select( array( 'page', 'imagelinks'), - array( 'page_namespace', 'page_title', 'page_id', 'page_len', 'page_is_redirect', 'page_latest' ), - array( 'page_id=il_from', 'il_to' => $encName ), - __METHOD__, - $options ); - - $retVal = array(); - if ( $db->numRows( $res ) ) { - foreach ( $res as $row ) { - $titleObj = Title::newFromRow( $row ); - if ( $titleObj ) { - $linkCache->addGoodLinkObj( $row->page_id, $titleObj, $row->page_len, $row->page_is_redirect, $row->page_latest ); - $retVal[] = $titleObj; - } - } - } - wfProfileOut( __METHOD__ ); - return $retVal; - } - function formatMetadata() { if ( !$this->getHandler() ) { return false; diff --git a/includes/media/Exif.php b/includes/media/Exif.php index fdb5a498bf..7857a56c3b 100644 --- a/includes/media/Exif.php +++ b/includes/media/Exif.php @@ -510,6 +510,8 @@ class Exif { /** * Use FormatMetadata to create formatted values for display to user * (is this ever used?) + * + * @deprecated since 1.18 */ function makeFormattedData( ) { wfDeprecated( __METHOD__ ); @@ -540,6 +542,8 @@ class Exif { * * This returns the data for display to user. * Its unclear if this is ever used. + * + * @deprecated since 1.18 */ function getFormattedData() { wfDeprecated( __METHOD__ ); diff --git a/includes/media/FormatMetadata.php b/includes/media/FormatMetadata.php index 38de34dd60..03324a97bc 100644 --- a/includes/media/FormatMetadata.php +++ b/includes/media/FormatMetadata.php @@ -1336,7 +1336,7 @@ class FormatMetadata { /** For compatability with old FormatExif class * which some extensions use. * - *@deprecated + * @deprecated since 1.18 * **/ class FormatExif { diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index f1391686bd..4c784a23bb 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -801,15 +801,6 @@ class Parser { return $rnd; } - /** - * Interface with html tidy - * @deprecated Use MWTidy::tidy() - */ - public static function tidy( $text ) { - wfDeprecated( __METHOD__ ); - return MWTidy::tidy( $text ); - } - /** * parse the wiki syntax used to render tables * diff --git a/includes/parser/ParserOptions.php b/includes/parser/ParserOptions.php index 56d6f7d18e..a310617ccb 100644 --- a/includes/parser/ParserOptions.php +++ b/includes/parser/ParserOptions.php @@ -93,7 +93,7 @@ class ParserOptions { /** * @param $title Title * @return Skin - * @deprecated Use Linker::* instead + * @deprecated since 1.18 Use Linker::* instead */ function getSkin( $title = null ) { wfDeprecated( __METHOD__ ); diff --git a/languages/Language.php b/languages/Language.php index 05972b56d4..75d11def4c 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -264,15 +264,6 @@ class Language { */ function initContLang() { } - /** - * @deprecated Use User::getDefaultOptions() - * @return array - */ - function getDefaultUserOptions() { - wfDeprecated( __METHOD__ ); - return User::getDefaultOptions(); - } - function getFallbackLanguageCode() { if ( $this->mCode === 'en' ) { return false; -- 2.20.1