r45025 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45024‎ | r45025 | r45026 >
Date:13:59, 25 December 2008
Author:siebrand
Status:ok
Tags:
Comment:
Some PHP 5.3 compatibility fixes for extensions
* replaced Namespace:: by MWNamespace::

These changes are incompatible with MediaWiki versions below 1.13 r32309
Modified paths:
  • /trunk/extensions/AdvancedRandom/AdvancedRandom_body.php (modified) (history)
  • /trunk/extensions/BackAndForth/BackAndForth.class.php (modified) (history)
  • /trunk/extensions/Cache404/extensions/Cache404.php (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/MV_ImageGallery.php (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/MV_MetavidInterface/MV_EditPageAjax.php (modified) (history)
  • /trunk/extensions/MiniPreview/MiniPreview.php (modified) (history)
  • /trunk/extensions/News/NewsRenderer.php (modified) (history)
  • /trunk/extensions/Polyglot/Polyglot.php (modified) (history)
  • /trunk/extensions/ProofreadPage/ProofreadPage.php (modified) (history)
  • /trunk/extensions/RDF/Rdf.php (modified) (history)
  • /trunk/extensions/RdfRedland/Modelers/DCmes.php (modified) (history)
  • /trunk/extensions/TalkHere/TalkHere.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Polyglot/Polyglot.php
@@ -91,7 +91,7 @@
9292
9393 if ( $ns < 0
9494 || in_array($ns, $wfPolyglotExcemptNamespaces)
95 - || ($wfPolyglotExcemptTalkPages && Namespace::isTalk($ns)) ) {
 95+ || ($wfPolyglotExcemptTalkPages && MWNamespace::isTalk($ns)) ) {
9696 return true;
9797 }
9898
@@ -194,7 +194,7 @@
195195 // at least if wgPolyglotFollowRedirects is true
196196
197197 if ( $ns >= 0 && !in_array($ns, $wfPolyglotExcemptNamespaces)
198 - && (!$wfPolyglotExcemptTalkPages || !Namespace::isTalk($ns)) ) {
 198+ && (!$wfPolyglotExcemptTalkPages || !MWNamespace::isTalk($ns)) ) {
199199 $ll = wfPolyglotGetLanguages($parser->mTitle);
200200 if ($ll) $links = array_merge($links, $ll);
201201
Index: trunk/extensions/BackAndForth/BackAndForth.class.php
@@ -17,7 +17,7 @@
1818 public static function viewHook( $article ) {
1919 global $wgOut, $wgUser;
2020 $title = $article->getTitle();
21 - if( Namespace::isContent( $title->getNamespace() ) ) {
 21+ if( MWNamespace::isContent( $title->getNamespace() ) ) {
2222 $wgOut->addHTML( self::buildLinks( $title ) );
2323 $wgOut->addHeadItem( 'backandforth', self::buildHeadItem() );
2424 }
Index: trunk/extensions/RdfRedland/Modelers/DCmes.php
@@ -76,7 +76,7 @@
7777 $this->Agent->getTimestampResource() ) );
7878 }
7979
80 - if ( Namespace::isTalk( $this->Agent->getTitle()->getNamespace() ) ) {
 80+ if ( MWNamespace::isTalk( $this->Agent->getTitle()->getNamespace() ) ) {
8181 $model->addStatement( MwRdf::Statement(
8282 $artres,
8383 $dc->subject,
Index: trunk/extensions/Cache404/extensions/Cache404.php
@@ -372,7 +372,7 @@
373373 }
374374
375375 function getTalkPartner($title) {
376 - if (Namespace::isTalk($title->getNamespace())) {
 376+ if ( MWNamespace::isTalk( $title->getNamespace() ) ) {
377377 return $title->getSubjectPage();
378378 } else {
379379 return $title->getTalkPage();
@@ -563,7 +563,7 @@
564564 $admins = '';
565565 $dbr =& wfGetDB( DB_SLAVE );
566566 $user_rights = $dbr->tableName( 'user_rights' );
567 - $userspace = Namespace::getUser();
 567+ $userspace = MWNamespace::getUser();
568568 $sql = "SELECT ur_user " .
569569 "FROM {$user_rights} " .
570570 "WHERE ur_rights LIKE '%sysop%' ";
Index: trunk/extensions/AdvancedRandom/AdvancedRandom_body.php
@@ -81,7 +81,7 @@
8282 );
8383 }
8484
85 - $title =& Title::makeTitle( Namespace::getSubject( $namespace ), $res->page_title );
 85+ $title =& Title::makeTitle( MWNamespace::getSubject( $namespace ), $res->page_title );
8686 if ( is_null( $title ) || $title->getText() == '' )
8787 $title = Title::newMainPage();;
8888 $this->redirect( $title );
Index: trunk/extensions/ProofreadPage/ProofreadPage.php
@@ -402,7 +402,7 @@
403403 $pagetable = $dbr->tableName( 'page' );
404404
405405 $page_namespace = preg_quote( wfMsgForContent( 'proofreadpage_namespace' ), '/' );
406 - $page_ns_index = Namespace::getCanonicalIndex( strtolower( $page_namespace ) );
 406+ $page_ns_index = MWNamespace::getCanonicalIndex( strtolower( $page_namespace ) );
407407 if( $page_ns_index == NULL ) {
408408 $page_ns_index = NS_MAIN;
409409 }
Index: trunk/extensions/TalkHere/TalkHere.php
@@ -74,9 +74,9 @@
7575
7676 $ns = $title->getNamespace();
7777
78 - if ( !Namespace::isTalk($ns) && Namespace::canTalk($ns) && $title->exists()
 78+ if ( !MWNamespace::isTalk($ns) && MWNamespace::canTalk($ns) && $title->exists()
7979 && ( !$wgTalkHereNamespaces || in_array($ns, $wgTalkHereNamespaces) ) ) {
80 - $tns = Namespace::getTalk($ns);
 80+ $tns = MWNamespace::getTalk($ns);
8181 $talk = Title::makeTitle($tns, $title->getDBkey());
8282
8383 if ($talk && $talk->userCan('read')) {
Index: trunk/extensions/News/NewsRenderer.php
@@ -150,7 +150,7 @@
151151 if ( $ns === '-' || $ns === '0' || $ns === 'main' || $ns === 'article' ) {
152152 $this->namespaces[$i] = 0;
153153 } else {
154 - $this->namespaces[$i] = Namespace::getCanonicalIndex( $ns );
 154+ $this->namespaces[$i] = MWNamespace::getCanonicalIndex( $ns );
155155 if ( $this->namespaces[$i] === false || $this->namespaces[$i] === NULL )
156156 $this->namespaces[$i] = $wgContLang->getNsIndex( $ns );
157157 }
Index: trunk/extensions/MetavidWiki/includes/MV_ImageGallery.php
@@ -108,7 +108,7 @@
109109 }
110110
111111 // TODO
112 - // $ul = $sk->makeLink( $wgContLang->getNsText( Namespace::getUser() ) . ":{$ut}", $ut );
 112+ // $ul = $sk->makeLink( $wgContLang->getNsText( MWNamespace::getUser() ) . ":{$ut}", $ut );
113113
114114 if ( $this->mShowBytes ) {
115115 if ( $img ) {
Index: trunk/extensions/MetavidWiki/includes/MV_MetavidInterface/MV_EditPageAjax.php
@@ -159,7 +159,7 @@
160160 $stream_name = MV_Stream::getStreamNameFromId( $mvd->stream_id );
161161
162162 $lTitle = Title::makeTitle( NS_SPECIAL, 'Userlogin' );
163 - $loginLink = $sk->makeLinkObj( $lTitle, wfMsg( 'login' ), 'returnto=' . Namespace::getCanonicalName( MV_NS_STREAM ) . ':' . $stream_name );
 163+ $loginLink = $sk->makeLinkObj( $lTitle, wfMsg( 'login' ), 'returnto=' . MWNamespace::getCanonicalName( MV_NS_STREAM ) . ':' . $stream_name );
164164
165165 $wgOut->addHTML( wfMsg( 'mv_user_cant_edit', $loginLink, $cancel ) );
166166 $wgOut->readOnlyPage( $this->mArticle->getContent(), true, $permErrors );
Index: trunk/extensions/MiniPreview/MiniPreview.php
@@ -133,7 +133,7 @@
134134 if ( $last_type != $p->from_category ) $html .= "<div class='MiniPreviewSeparator'>&nbsp;</div>" ; # Visually separate categories from galleries
135135 $last_type = $p->from_category;
136136 $nsid = $p->from_category ? 14 : $wgMiniPreviewGalleryNamespace ;
137 - $ns = Namespace::getCanonicalName ( $nsid ) . ':' ;
 137+ $ns = MWNamespace::getCanonicalName ( $nsid ) . ':' ;
138138 $t = Title::newFromDBkey( $ns . $p->source_title );
139139 $mode = ( $p->from_category ? "category" : "gallery" ) ;
140140
Index: trunk/extensions/RDF/Rdf.php
@@ -448,7 +448,7 @@
449449 $model->add(new Statement($artres, $DCMES['date'],
450450 MwRdfTimestamp($article->getTimestamp())));
451451
452 - if (Namespace::isTalk($nt->getNamespace())) {
 452+ if ( MWNamespace::isTalk( $nt->getNamespace() ) ) {
453453 $model->add(new Statement($artres, $DCMES['subject'],
454454 MwRdfTitleResource($nt->getSubjectPage())));
455455 } else {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r32309* (bug 12294) Namespace class renamed to MWNamespace for PHP 5.3 compatibility...brion23:13, 21 March 2008

Status & tagging log