r87593 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87592‎ | r87593 | r87594 >
Date:22:53, 6 May 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Documentation

Remove some deprecated in 1.16 functions with no callers
Modified paths:
  • /trunk/phase3/includes/Linker.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Linker.php
@@ -317,6 +317,8 @@
318318 * Default text of the links to the Title $target
319319 *
320320 * @param $target Title
 321+ *
 322+ * @return string
321323 */
322324 private static function linkText( $target ) {
323325 # We might be passed a non-Title by make*LinkObj(). Fail gracefully.
@@ -361,6 +363,8 @@
362364 * despite $query not being used.
363365 *
364366 * @param $nt Title
 367+ *
 368+ * @return string
365369 */
366370 static function makeSelfLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
367371 if ( $text == '' ) {
@@ -370,6 +374,10 @@
371375 return "<strong class=\"selflink\">{$prefix}{$text}{$inside}</strong>{$trail}";
372376 }
373377
 378+ /**
 379+ * @param $title Title
 380+ * @return Title
 381+ */
374382 static function normaliseSpecialPage( Title $title ) {
375383 if ( $title->getNamespace() == NS_SPECIAL ) {
376384 list( $name, $subpage ) = SpecialPageFactory::resolveAlias( $title->getDBkey() );
@@ -387,6 +395,10 @@
388396 /**
389397 * Returns the filename part of an url.
390398 * Used as alternative text for external images.
 399+ *
 400+ * @param $url string
 401+ *
 402+ * @return string
391403 */
392404 static function fnamePart( $url ) {
393405 $basename = strrchr( $url, '/' );
@@ -401,6 +413,11 @@
402414 /**
403415 * Return the code for images which were added via external links,
404416 * via Parser::maybeMakeExternalImage().
 417+ *
 418+ * @param $url
 419+ * @param $alt
 420+ *
 421+ * @return string
405422 */
406423 static function makeExternalImage( $url, $alt = '' ) {
407424 if ( $alt == '' ) {
@@ -1740,60 +1757,6 @@
17411758 /**
17421759 * @deprecated since 1.16 Use link()
17431760 *
1744 - * This function is a shortcut to makeLinkObj(Title::newFromText($title),...). Do not call
1745 - * it if you already have a title object handy. See makeLinkObj for further documentation.
1746 - *
1747 - * @param $title String: the text of the title
1748 - * @param $text String: link text
1749 - * @param $query String: optional query part
1750 - * @param $trail String: optional trail. Alphabetic characters at the start of this string will
1751 - * be included in the link text. Other characters will be appended after
1752 - * the end of the link.
1753 - */
1754 - static function makeLink( $title, $text = '', $query = '', $trail = '' ) {
1755 - wfProfileIn( __METHOD__ );
1756 - $nt = Title::newFromText( $title );
1757 - if ( $nt instanceof Title ) {
1758 - $result = self::makeLinkObj( $nt, $text, $query, $trail );
1759 - } else {
1760 - wfDebug( 'Invalid title passed to self::makeLink(): "' . $title . "\"\n" );
1761 - $result = $text == "" ? $title : $text;
1762 - }
1763 -
1764 - wfProfileOut( __METHOD__ );
1765 - return $result;
1766 - }
1767 -
1768 - /**
1769 - * @deprecated since 1.16 Use link()
1770 - *
1771 - * This function is a shortcut to makeKnownLinkObj(Title::newFromText($title),...). Do not call
1772 - * it if you already have a title object handy. See makeKnownLinkObj for further documentation.
1773 - *
1774 - * @param $title String: the text of the title
1775 - * @param $text String: link text
1776 - * @param $query String: optional query part
1777 - * @param $trail String: optional trail. Alphabetic characters at the start of this string will
1778 - * be included in the link text. Other characters will be appended after
1779 - * the end of the link.
1780 - * @param $prefix String: Optional prefix
1781 - * @param $aprops String: extra attributes to the a-element
1782 - */
1783 - static function makeKnownLink(
1784 - $title, $text = '', $query = '', $trail = '', $prefix = '', $aprops = ''
1785 - ) {
1786 - $nt = Title::newFromText( $title );
1787 - if ( $nt instanceof Title ) {
1788 - return self::makeKnownLinkObj( $nt, $text, $query, $trail, $prefix , $aprops );
1789 - } else {
1790 - wfDebug( 'Invalid title passed to self::makeKnownLink(): "' . $title . "\"\n" );
1791 - return $text == '' ? $title : $text;
1792 - }
1793 - }
1794 -
1795 - /**
1796 - * @deprecated since 1.16 Use link()
1797 - *
17981761 * This function is a shortcut to makeBrokenLinkObj(Title::newFromText($title),...). Do not call
17991762 * it if you already have a title object handy. See makeBrokenLinkObj for further documentation.
18001763 *
@@ -1914,23 +1877,6 @@
19151878 /**
19161879 * @deprecated since 1.16 Use link()
19171880 *
1918 - * Make a brown link to a short article.
1919 - *
1920 - * @param $nt Title object of the target page
1921 - * @param $text String: link text
1922 - * @param $query String: optional query part
1923 - * @param $trail String: optional trail. Alphabetic characters at the start of this string will
1924 - * be included in the link text. Other characters will be appended after
1925 - * the end of the link.
1926 - * @param $prefix String: Optional prefix
1927 - */
1928 - static function makeStubLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
1929 - return self::makeColouredLinkObj( $nt, 'stub', $text, $query, $trail, $prefix );
1930 - }
1931 -
1932 - /**
1933 - * @deprecated since 1.16 Use link()
1934 - *
19351881 * Make a coloured link.
19361882 *
19371883 * @param $nt Title object of the target page

Follow-up revisions

RevisionCommit summaryAuthorDate
r87777(follow-up r87593 / bug 28875) Replace calls to makeKnownLink with Linker::li...bawolff22:53, 9 May 2011
r90580Followup r87593, fix calls to removed methodsreedy12:03, 22 June 2011

Comments

#Comment by Aaron Schulz (talk | contribs)   04:43, 22 June 2011

MW_EditPageAjax.php is still using makeKnownLink().

Also, for makeLink():

C:\wamp\www\MW_trunk\extensions\Asksql\Asksql_body.php 
00145: $link = $skin->makeLink( $link );
  
C:\wamp\www\MW_trunk\extensions\ImageTagging\ImageTagging_body.php 
00265: // $ul = $sk->makeLink( $wgContLang->getNsText( MWNamespace::getUser() ) . ":{$ut}", $ut );
  
C:\wamp\www\MW_trunk\extensions\MetavidWiki\includes\MV_ImageGallery.php 
00110: // $ul = $sk->makeLink( $wgContLang->getNsText( MWNamespace::getUser() ) . ":{$ut}", $ut );
  
C:\wamp\www\MW_trunk\extensions\TalkHere\TalkHere.php 
00050: $cancel = $sk->makeLink( $returnto, wfMsgExt('cancel', array('parseinline')) );
  
C:\wamp\www\MW_trunk\extensions\Wikidata\OmegaWiki\Editor.php 
02110: return $wgUser->getSkin()->makeLink( "User:" . $value, $value );
  
C:\wamp\www\MW_trunk\extensions\WikiForum\WikiForumClass.php 
02344: $retVal = $sk->makeLink(

Status & tagging log