Index: trunk/phase3/maintenance/generateSitemap.php |
— | — | @@ -200,7 +200,7 @@ |
201 | 201 | * @return string |
202 | 202 | */ |
203 | 203 | function guessPriority( $namespace ) { |
204 | | - return Namespace::isMain( $namespace ) ? $this->priorities[GS_MAIN] : $this->priorities[GS_TALK]; |
| 204 | + return MWNamespace::isMain( $namespace ) ? $this->priorities[GS_MAIN] : $this->priorities[GS_TALK]; |
205 | 205 | } |
206 | 206 | |
207 | 207 | /** |
Index: trunk/phase3/includes/RecentChange.php |
— | — | @@ -547,7 +547,7 @@ |
548 | 548 | |
549 | 549 | $titleObj =& $this->getTitle(); |
550 | 550 | if ( $rc_type == RC_LOG ) { |
551 | | - $title = Namespace::getCanonicalName( $titleObj->getNamespace() ) . $titleObj->getText(); |
| 551 | + $title = MWNamespace::getCanonicalName( $titleObj->getNamespace() ) . $titleObj->getText(); |
552 | 552 | } else { |
553 | 553 | $title = $titleObj->getPrefixedText(); |
554 | 554 | } |
Index: trunk/phase3/includes/NamespaceCompat.php |
— | — | @@ -0,0 +1,10 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +// For compatibility with extensions... |
| 5 | +// Will still die on PHP 5.3, of course. :P |
| 6 | + |
| 7 | +class Namespace extends MWNamespace { |
| 8 | + // .. |
| 9 | +} |
| 10 | + |
| 11 | +?> |
\ No newline at end of file |
Property changes on: trunk/phase3/includes/NamespaceCompat.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 12 | + native |
Index: trunk/phase3/includes/Linker.php |
— | — | @@ -1065,7 +1065,7 @@ |
1066 | 1066 | protected function formatLinksInCommentCallback( $match ) { |
1067 | 1067 | global $wgContLang; |
1068 | 1068 | |
1069 | | - $medians = '(?:' . preg_quote( Namespace::getCanonicalName( NS_MEDIA ), '/' ) . '|'; |
| 1069 | + $medians = '(?:' . preg_quote( MWNamespace::getCanonicalName( NS_MEDIA ), '/' ) . '|'; |
1070 | 1070 | $medians .= preg_quote( $wgContLang->getNsText( NS_MEDIA ), '/' ) . '):'; |
1071 | 1071 | |
1072 | 1072 | $comment = $match[0]; |
Index: trunk/phase3/includes/filerepo/FileRepo.php |
— | — | @@ -169,10 +169,10 @@ |
170 | 170 | if ( is_null( $this->descBaseUrl ) ) { |
171 | 171 | if ( !is_null( $this->articleUrl ) ) { |
172 | 172 | $this->descBaseUrl = str_replace( '$1', |
173 | | - wfUrlencode( Namespace::getCanonicalName( NS_IMAGE ) ) . ':', $this->articleUrl ); |
| 173 | + wfUrlencode( MWNamespace::getCanonicalName( NS_IMAGE ) ) . ':', $this->articleUrl ); |
174 | 174 | } elseif ( !is_null( $this->scriptDirUrl ) ) { |
175 | 175 | $this->descBaseUrl = $this->scriptDirUrl . '/index.php?title=' . |
176 | | - wfUrlencode( Namespace::getCanonicalName( NS_IMAGE ) ) . ':'; |
| 176 | + wfUrlencode( MWNamespace::getCanonicalName( NS_IMAGE ) ) . ':'; |
177 | 177 | } else { |
178 | 178 | $this->descBaseUrl = false; |
179 | 179 | } |
— | — | @@ -207,7 +207,7 @@ |
208 | 208 | function getDescriptionRenderUrl( $name ) { |
209 | 209 | if ( isset( $this->scriptDirUrl ) ) { |
210 | 210 | return $this->scriptDirUrl . '/index.php?title=' . |
211 | | - wfUrlencode( Namespace::getCanonicalName( NS_IMAGE ) . ':' . $name ) . |
| 211 | + wfUrlencode( MWNamespace::getCanonicalName( NS_IMAGE ) . ':' . $name ) . |
212 | 212 | '&action=render'; |
213 | 213 | } else { |
214 | 214 | $descBase = $this->getDescBaseUrl(); |
Index: trunk/phase3/includes/Export.php |
— | — | @@ -668,7 +668,7 @@ |
669 | 669 | */ |
670 | 670 | class DumpNotalkFilter extends DumpFilter { |
671 | 671 | function pass( $page ) { |
672 | | - return !Namespace::isTalk( $page->page_namespace ); |
| 672 | + return !MWNamespace::isTalk( $page->page_namespace ); |
673 | 673 | } |
674 | 674 | } |
675 | 675 | |
Index: trunk/phase3/includes/Hooks.php |
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | * careful about its contents. So, there's a lot more error-checking |
29 | 29 | * in here than would normally be necessary. |
30 | 30 | */ |
31 | | -function wfRunHooks($event, $args = null) { |
| 31 | +function wfRunHooks($event, $args = array()) { |
32 | 32 | |
33 | 33 | global $wgHooks; |
34 | 34 | |
Index: trunk/phase3/includes/Parser_OldPP.php |
— | — | @@ -4156,7 +4156,7 @@ |
4157 | 4157 | $colours[$pdbk] = ( $threshold == 0 || ( |
4158 | 4158 | $s->page_len >= $threshold || # always true if $threshold <= 0 |
4159 | 4159 | $s->page_is_redirect || |
4160 | | - !Namespace::isContent( $s->page_namespace ) ) |
| 4160 | + !MWNamespace::isContent( $s->page_namespace ) ) |
4161 | 4161 | ? 1 : 2 ); |
4162 | 4162 | } |
4163 | 4163 | } |
Index: trunk/phase3/includes/AutoLoader.php |
— | — | @@ -156,8 +156,9 @@ |
157 | 157 | 'MostrevisionsPage' => 'includes/SpecialMostrevisions.php', |
158 | 158 | 'MovePageForm' => 'includes/SpecialMovepage.php', |
159 | 159 | 'MWException' => 'includes/Exception.php', |
| 160 | + 'MWNamespace' => 'includes/Namespace.php', |
160 | 161 | 'MySQLSearchResultSet' => 'includes/SearchMySQL.php', |
161 | | - 'Namespace' => 'includes/Namespace.php', |
| 162 | + 'Namespace' => 'includes/NamespaceCompat.php', // Compat |
162 | 163 | 'NewbieContributionsPage' => 'includes/SpecialNewbieContributions.php', |
163 | 164 | 'NewPagesPage' => 'includes/SpecialNewpages.php', |
164 | 165 | 'OldChangesList' => 'includes/ChangesList.php', |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -577,7 +577,7 @@ |
578 | 578 | */ |
579 | 579 | public function getSubjectNsText() { |
580 | 580 | global $wgContLang; |
581 | | - return $wgContLang->getNsText( Namespace::getSubject( $this->mNamespace ) ); |
| 581 | + return $wgContLang->getNsText( MWNamespace::getSubject( $this->mNamespace ) ); |
582 | 582 | } |
583 | 583 | |
584 | 584 | /** |
— | — | @@ -586,7 +586,7 @@ |
587 | 587 | */ |
588 | 588 | public function getTalkNsText() { |
589 | 589 | global $wgContLang; |
590 | | - return( $wgContLang->getNsText( Namespace::getTalk( $this->mNamespace ) ) ); |
| 590 | + return( $wgContLang->getNsText( MWNamespace::getTalk( $this->mNamespace ) ) ); |
591 | 591 | } |
592 | 592 | |
593 | 593 | /** |
— | — | @@ -594,7 +594,7 @@ |
595 | 595 | * @return bool |
596 | 596 | */ |
597 | 597 | public function canTalk() { |
598 | | - return( Namespace::canTalk( $this->mNamespace ) ); |
| 598 | + return( MWNamespace::canTalk( $this->mNamespace ) ); |
599 | 599 | } |
600 | 600 | |
601 | 601 | /** |
— | — | @@ -1377,7 +1377,7 @@ |
1378 | 1378 | * @return boolean |
1379 | 1379 | */ |
1380 | 1380 | public function isMovable() { |
1381 | | - return Namespace::isMovable( $this->getNamespace() ) |
| 1381 | + return MWNamespace::isMovable( $this->getNamespace() ) |
1382 | 1382 | && $this->getInterwiki() == ''; |
1383 | 1383 | } |
1384 | 1384 | |
— | — | @@ -1461,7 +1461,7 @@ |
1462 | 1462 | * @return bool |
1463 | 1463 | */ |
1464 | 1464 | public function isTalkPage() { |
1465 | | - return Namespace::isTalk( $this->getNamespace() ); |
| 1465 | + return MWNamespace::isTalk( $this->getNamespace() ); |
1466 | 1466 | } |
1467 | 1467 | |
1468 | 1468 | /** |
— | — | @@ -2140,7 +2140,7 @@ |
2141 | 2141 | * @return Title the object for the talk page |
2142 | 2142 | */ |
2143 | 2143 | public function getTalkPage() { |
2144 | | - return Title::makeTitle( Namespace::getTalk( $this->getNamespace() ), $this->getDBkey() ); |
| 2144 | + return Title::makeTitle( MWNamespace::getTalk( $this->getNamespace() ), $this->getDBkey() ); |
2145 | 2145 | } |
2146 | 2146 | |
2147 | 2147 | /** |
— | — | @@ -2150,7 +2150,7 @@ |
2151 | 2151 | * @return Title the object for the subject page |
2152 | 2152 | */ |
2153 | 2153 | public function getSubjectPage() { |
2154 | | - return Title::makeTitle( Namespace::getSubject( $this->getNamespace() ), $this->getDBkey() ); |
| 2154 | + return Title::makeTitle( MWNamespace::getSubject( $this->getNamespace() ), $this->getDBkey() ); |
2155 | 2155 | } |
2156 | 2156 | |
2157 | 2157 | /** |
— | — | @@ -2691,7 +2691,7 @@ |
2692 | 2692 | */ |
2693 | 2693 | public function isWatchable() { |
2694 | 2694 | return !$this->isExternal() |
2695 | | - && Namespace::isWatchable( $this->getNamespace() ); |
| 2695 | + && MWNamespace::isWatchable( $this->getNamespace() ); |
2696 | 2696 | } |
2697 | 2697 | |
2698 | 2698 | /** |
— | — | @@ -2986,7 +2986,7 @@ |
2987 | 2987 | * @return bool |
2988 | 2988 | */ |
2989 | 2989 | public function isContentPage() { |
2990 | | - return Namespace::isContent( $this->getNamespace() ); |
| 2990 | + return MWNamespace::isContent( $this->getNamespace() ); |
2991 | 2991 | } |
2992 | 2992 | |
2993 | 2993 | } |
Index: trunk/phase3/includes/Namespace.php |
— | — | @@ -42,12 +42,8 @@ |
43 | 43 | * |
44 | 44 | */ |
45 | 45 | |
46 | | -/* |
47 | | -WARNING: The statement below may fail on some versions of PHP: see bug 12294 |
48 | | -*/ |
| 46 | +class MWNamespace { |
49 | 47 | |
50 | | -class Namespace { |
51 | | - |
52 | 48 | /** |
53 | 49 | * Can pages in the given namespace be moved? |
54 | 50 | * |
Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -596,7 +596,7 @@ |
597 | 597 | $text = wfMsg( $message ); |
598 | 598 | if ( wfEmptyMsg( $message, $text ) ) { |
599 | 599 | global $wgContLang; |
600 | | - $text = $wgContLang->getFormattedNsText( Namespace::getSubject( $title->getNamespace() ) ); |
| 600 | + $text = $wgContLang->getFormattedNsText( MWNamespace::getSubject( $title->getNamespace() ) ); |
601 | 601 | } |
602 | 602 | |
603 | 603 | $result = array(); |
Index: trunk/phase3/includes/CoreParserFunctions.php |
— | — | @@ -68,7 +68,7 @@ |
69 | 69 | $found = true; |
70 | 70 | } else { |
71 | 71 | $param = str_replace( ' ', '_', strtolower( $part1 ) ); |
72 | | - $index = Namespace::getCanonicalIndex( strtolower( $param ) ); |
| 72 | + $index = MWNamespace::getCanonicalIndex( strtolower( $param ) ); |
73 | 73 | if ( !is_null( $index ) ) { |
74 | 74 | $text = $wgContLang->getNsText( $index ); |
75 | 75 | $found = true; |
Index: trunk/phase3/languages/Language.php |
— | — | @@ -264,7 +264,7 @@ |
265 | 265 | function getNsIndex( $text ) { |
266 | 266 | $this->load(); |
267 | 267 | $lctext = $this->lc($text); |
268 | | - if( ( $ns = Namespace::getCanonicalIndex( $lctext ) ) !== null ) return $ns; |
| 268 | + if( ( $ns = MWNamespace::getCanonicalIndex( $lctext ) ) !== null ) return $ns; |
269 | 269 | return isset( $this->mNamespaceIds[$lctext] ) ? $this->mNamespaceIds[$lctext] : false; |
270 | 270 | } |
271 | 271 | |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -118,6 +118,8 @@ |
119 | 119 | using the "delete and move" option. |
120 | 120 | * (bug 13466) White space differences not shown in diffs |
121 | 121 | * (bug 1953) Search form now honors namespace selections more reliably |
| 122 | +* (bug 12294) Namespace class renamed to MWNamespace for PHP 5.3 compatibility |
| 123 | +* PHP 5.3 compatibility fix for wfRunHooks() called with no parameters |
122 | 124 | |
123 | 125 | |
124 | 126 | === API changes in 1.13 === |