Index: trunk/phase3/includes/Article.php |
— | — | @@ -207,7 +207,7 @@ |
208 | 208 | * the shortcut in Article::followContent() |
209 | 209 | * |
210 | 210 | * @return Return the text of this revision |
211 | | - */ |
| 211 | + */ |
212 | 212 | public function getContent() { |
213 | 213 | global $wgUser, $wgContLang, $wgOut, $wgMessageCache; |
214 | 214 | wfProfileIn( __METHOD__ ); |
— | — | @@ -237,7 +237,7 @@ |
238 | 238 | * Get the text of the current revision. No side-effects... |
239 | 239 | * |
240 | 240 | * @return Return the text of the current revision |
241 | | - */ |
| 241 | + */ |
242 | 242 | public function getRawText() { |
243 | 243 | // Check process cache for current revision |
244 | 244 | if( $this->mContentLoaded && $this->mOldId == 0 ) { |
— | — | @@ -728,9 +728,9 @@ |
729 | 729 | } |
730 | 730 | |
731 | 731 | /** |
732 | | - * This is the default action of the index.php entry point: just view the |
| 732 | + * This is the default action of the index.php entry point: just view the |
733 | 733 | * page of the given title. |
734 | | - */ |
| 734 | + */ |
735 | 735 | public function view() { |
736 | 736 | global $wgUser, $wgOut, $wgRequest, $wgContLang; |
737 | 737 | global $wgEnableParserCache, $wgStylePath, $wgParser; |
— | — | @@ -940,7 +940,7 @@ |
941 | 941 | */ |
942 | 942 | public function showDiffPage() { |
943 | 943 | global $wgOut, $wgRequest, $wgUser; |
944 | | - |
| 944 | + |
945 | 945 | $diff = $wgRequest->getVal( 'diff' ); |
946 | 946 | $rcid = $wgRequest->getVal( 'rcid' ); |
947 | 947 | $diffOnly = $wgRequest->getBool( 'diffonly', $wgUser->getOption( 'diffonly' ) ); |
— | — | @@ -962,10 +962,10 @@ |
963 | 963 | } |
964 | 964 | |
965 | 965 | /** |
966 | | - * Show a page view for a page formatted as CSS or JavaScript. To be called by |
| 966 | + * Show a page view for a page formatted as CSS or JavaScript. To be called by |
967 | 967 | * Article::view() only. |
968 | 968 | * |
969 | | - * This is hooked by SyntaxHighlight_GeSHi to do syntax highlighting of these |
| 969 | + * This is hooked by SyntaxHighlight_GeSHi to do syntax highlighting of these |
970 | 970 | * page views. |
971 | 971 | */ |
972 | 972 | public function showCssOrJsPage() { |
— | — | @@ -993,7 +993,7 @@ |
994 | 994 | $policy = $this->getRobotPolicy( 'view' ); |
995 | 995 | return $policy['index'] . ',' . $policy['follow']; |
996 | 996 | } |
997 | | - |
| 997 | + |
998 | 998 | /** |
999 | 999 | * Get the robot policy to be used for the current view |
1000 | 1000 | * @param $action String the action= GET parameter |
— | — | @@ -1001,7 +1001,7 @@ |
1002 | 1002 | * TODO: actions other than 'view' |
1003 | 1003 | */ |
1004 | 1004 | public function getRobotPolicy( $action ){ |
1005 | | - |
| 1005 | + |
1006 | 1006 | global $wgOut, $wgArticleRobotPolicies, $wgNamespaceRobotPolicies; |
1007 | 1007 | global $wgDefaultRobotPolicy, $wgRequest; |
1008 | 1008 | |
— | — | @@ -1085,8 +1085,8 @@ |
1086 | 1086 | } |
1087 | 1087 | |
1088 | 1088 | /** |
1089 | | - * If this request is a redirect view, send "redirected from" subtitle to |
1090 | | - * $wgOut. Returns true if the header was needed, false if this is not a |
| 1089 | + * If this request is a redirect view, send "redirected from" subtitle to |
| 1090 | + * $wgOut. Returns true if the header was needed, false if this is not a |
1091 | 1091 | * redirect view. Handles both local and remote redirects. |
1092 | 1092 | */ |
1093 | 1093 | public function showRedirectedFromHeader() { |
— | — | @@ -1134,7 +1134,7 @@ |
1135 | 1135 | } |
1136 | 1136 | |
1137 | 1137 | /** |
1138 | | - * Show a header specific to the namespace currently being viewed, like |
| 1138 | + * Show a header specific to the namespace currently being viewed, like |
1139 | 1139 | * [[MediaWiki:Talkpagetext]]. For Article::view(). |
1140 | 1140 | */ |
1141 | 1141 | public function showNamespaceHeader() { |
— | — | @@ -1168,8 +1168,8 @@ |
1169 | 1169 | } |
1170 | 1170 | |
1171 | 1171 | /** |
1172 | | - * If patrol is possible, output a patrol UI box. This is called from the |
1173 | | - * footer section of ordinary page views. If patrol is not possible or not |
| 1172 | + * If patrol is possible, output a patrol UI box. This is called from the |
| 1173 | + * footer section of ordinary page views. If patrol is not possible or not |
1174 | 1174 | * desired, does nothing. |
1175 | 1175 | */ |
1176 | 1176 | public function showPatrolFooter() { |
— | — | @@ -1199,10 +1199,10 @@ |
1200 | 1200 | ) . |
1201 | 1201 | '</div>' |
1202 | 1202 | ); |
1203 | | - } |
| 1203 | + } |
1204 | 1204 | |
1205 | 1205 | /** |
1206 | | - * Show the error text for a missing article. For articles in the MediaWiki |
| 1206 | + * Show the error text for a missing article. For articles in the MediaWiki |
1207 | 1207 | * namespace, show the default message text. To be called from Article::view(). |
1208 | 1208 | */ |
1209 | 1209 | public function showMissingArticle() { |
— | — | @@ -1225,13 +1225,13 @@ |
1226 | 1226 | array( 'lim' => 10, |
1227 | 1227 | 'conds' => array( "log_action != 'revision'" ), |
1228 | 1228 | 'showIfEmpty' => false, |
1229 | | - 'msgKey' => array( 'moveddeleted-notice' ) ) |
| 1229 | + 'msgKey' => array( 'moveddeleted-notice' ) ) |
1230 | 1230 | ); |
1231 | 1231 | |
1232 | 1232 | # Show error message |
1233 | 1233 | $oldid = $this->getOldID(); |
1234 | 1234 | if( $oldid ) { |
1235 | | - $text = wfMsgNoTrans( 'missing-article', |
| 1235 | + $text = wfMsgNoTrans( 'missing-article', |
1236 | 1236 | $this->mTitle->getPrefixedText(), |
1237 | 1237 | wfMsgNoTrans( 'missingarticle-rev', $oldid ) ); |
1238 | 1238 | } elseif ( $this->mTitle->getNamespace() === NS_MEDIAWIKI ) { |
— | — | @@ -1241,7 +1241,7 @@ |
1242 | 1242 | $createErrors = $this->mTitle->getUserPermissionsErrors( 'create', $wgUser ); |
1243 | 1243 | $editErrors = $this->mTitle->getUserPermissionsErrors( 'edit', $wgUser ); |
1244 | 1244 | $errors = array_merge( $createErrors, $editErrors ); |
1245 | | - |
| 1245 | + |
1246 | 1246 | if ( !count($errors) ) |
1247 | 1247 | $text = wfMsgNoTrans( 'noarticletext' ); |
1248 | 1248 | else |
— | — | @@ -1257,7 +1257,7 @@ |
1258 | 1258 | } |
1259 | 1259 | |
1260 | 1260 | /** |
1261 | | - * If the revision requested for view is deleted, check permissions. |
| 1261 | + * If the revision requested for view is deleted, check permissions. |
1262 | 1262 | * Send either an error message or a warning header to $wgOut. |
1263 | 1263 | * Returns true if the view is allowed, false if not. |
1264 | 1264 | */ |
— | — | @@ -1322,9 +1322,9 @@ |
1323 | 1323 | } |
1324 | 1324 | |
1325 | 1325 | /** |
1326 | | - * Try to fetch an expired entry from the parser cache. If it is present, |
1327 | | - * output it and return true. If it is not present, output nothing and |
1328 | | - * return false. This is used as a callback function for |
| 1326 | + * Try to fetch an expired entry from the parser cache. If it is present, |
| 1327 | + * output it and return true. If it is not present, output nothing and |
| 1328 | + * return false. This is used as a callback function for |
1329 | 1329 | * PoolCounter::executeProtected(). |
1330 | 1330 | */ |
1331 | 1331 | public function tryDirtyCache() { |
— | — | @@ -1358,7 +1358,7 @@ |
1359 | 1359 | $wgOut->enableClientCache( false ); |
1360 | 1360 | $wgOut->setRobotPolicy( 'noindex,nofollow' ); |
1361 | 1361 | $wgOut->addWikiText( |
1362 | | - '<div class="errorbox">' . |
| 1362 | + '<div class="errorbox">' . |
1363 | 1363 | $status->getWikiText( false, 'view-pool-error' ) . |
1364 | 1364 | '</div>' |
1365 | 1365 | ); |
— | — | @@ -1575,7 +1575,7 @@ |
1576 | 1576 | * Giving 0 indicates the new page flag should be set |
1577 | 1577 | * on. |
1578 | 1578 | * @param $lastRevIsRedirect Boolean: if given, will optimize adding and |
1579 | | - * removing rows in redirect table. |
| 1579 | + * removing rows in redirect table. |
1580 | 1580 | * @return bool true on success, false on failure |
1581 | 1581 | * @private |
1582 | 1582 | */ |
— | — | @@ -1616,9 +1616,9 @@ |
1617 | 1617 | * |
1618 | 1618 | * @param $dbw Database |
1619 | 1619 | * @param $redirectTitle a title object pointing to the redirect target, |
1620 | | - * or NULL if this is not a redirect |
| 1620 | + * or NULL if this is not a redirect |
1621 | 1621 | * @param $lastRevIsRedirect If given, will optimize adding and |
1622 | | - * removing rows in redirect table. |
| 1622 | + * removing rows in redirect table. |
1623 | 1623 | * @return bool true on success, false on failure |
1624 | 1624 | * @private |
1625 | 1625 | */ |
— | — | @@ -2159,7 +2159,6 @@ |
2160 | 2160 | /** |
2161 | 2161 | * User-interface handler for the "watch" action |
2162 | 2162 | */ |
2163 | | - |
2164 | 2163 | public function watch() { |
2165 | 2164 | global $wgUser, $wgOut; |
2166 | 2165 | if( $wgUser->isAnon() ) { |
— | — | @@ -2257,7 +2256,7 @@ |
2258 | 2257 | */ |
2259 | 2258 | public function updateRestrictions( $limit = array(), $reason = '', &$cascade = 0, $expiry = array() ) { |
2260 | 2259 | global $wgUser, $wgContLang; |
2261 | | - |
| 2260 | + |
2262 | 2261 | $restrictionTypes = $this->mTitle->getRestrictionTypes(); |
2263 | 2262 | |
2264 | 2263 | $id = $this->mTitle->getArticleID(); |
— | — | @@ -2640,7 +2639,7 @@ |
2641 | 2640 | //return $dbr->selectField( 'revision', 'COUNT(*)', |
2642 | 2641 | // array( 'rev_page' => $this->getId() ), __METHOD__ ); |
2643 | 2642 | return $dbr->estimateRowCount( 'revision', '*', |
2644 | | - array( 'rev_page' => $this->getId() ), __METHOD__ ); |
| 2643 | + array( 'rev_page' => $this->getId() ), __METHOD__ ); |
2645 | 2644 | } |
2646 | 2645 | |
2647 | 2646 | /** |
— | — | @@ -2707,7 +2706,7 @@ |
2708 | 2707 | $wgOut->setSubtitle( wfMsgHtml( 'delete-backlink', $deleteBackLink ) ); |
2709 | 2708 | $wgOut->setRobotPolicy( 'noindex,nofollow' ); |
2710 | 2709 | $wgOut->addWikiMsg( 'confirmdeletetext' ); |
2711 | | - |
| 2710 | + |
2712 | 2711 | wfRunHooks( 'ArticleConfirmDelete', array( $this, $wgOut, &$reason ) ); |
2713 | 2712 | |
2714 | 2713 | if( $wgUser->isAllowed( 'suppressrevision' ) ) { |
— | — | @@ -3060,10 +3059,10 @@ |
3061 | 3060 | $user_text = $dbw->addQuotes( $current->getRawUserText() ); |
3062 | 3061 | $s = $dbw->selectRow( 'revision', |
3063 | 3062 | array( 'rev_id', 'rev_timestamp', 'rev_deleted' ), |
3064 | | - array( 'rev_page' => $current->getPage(), |
| 3063 | + array( 'rev_page' => $current->getPage(), |
3065 | 3064 | "rev_user != {$user} OR rev_user_text != {$user_text}" |
3066 | 3065 | ), __METHOD__, |
3067 | | - array( 'USE INDEX' => 'page_timestamp', |
| 3066 | + array( 'USE INDEX' => 'page_timestamp', |
3068 | 3067 | 'ORDER BY' => 'rev_timestamp DESC' ) |
3069 | 3068 | ); |
3070 | 3069 | if( $s === false ) { |
— | — | @@ -3495,7 +3494,7 @@ |
3496 | 3495 | $r = "\n\t\t\t\t<div id=\"mw-{$infomsg}\">" . |
3497 | 3496 | wfMsgExt( |
3498 | 3497 | $infomsg, |
3499 | | - array( 'parseinline', 'replaceafter' ), |
| 3498 | + array( 'parseinline', 'replaceafter' ), |
3500 | 3499 | $td, |
3501 | 3500 | $userlinks, |
3502 | 3501 | $revision->getID(), |
— | — | @@ -3698,7 +3697,6 @@ |
3699 | 3698 | * |
3700 | 3699 | * @param $title a title object |
3701 | 3700 | */ |
3702 | | - |
3703 | 3701 | public static function onArticleCreate( $title ) { |
3704 | 3702 | # Update existence markers on article/talk tabs... |
3705 | 3703 | if( $title->isTalkPage() ) { |
— | — | @@ -3980,7 +3978,7 @@ |
3981 | 3979 | $this->mParserOutput = $this->getOutputFromWikitext( $text, $cache, $parserOptions ); |
3982 | 3980 | $wgOut->addParserOutput( $this->mParserOutput ); |
3983 | 3981 | } |
3984 | | - |
| 3982 | + |
3985 | 3983 | /** |
3986 | 3984 | * This does all the heavy lifting for outputWikitext, except it returns the parser |
3987 | 3985 | * output instead of sending it straight to $wgOut. Makes things nice and simple for, |
— | — | @@ -4103,8 +4101,10 @@ |
4104 | 4102 | } |
4105 | 4103 | $insertRows = array(); |
4106 | 4104 | foreach( $insertCats as $cat ) { |
4107 | | - $insertRows[] = array( 'cat_id' => $dbw->nextSequenceValue( 'category_cat_id_seq' ), |
4108 | | - 'cat_title' => $cat ); |
| 4105 | + $insertRows[] = array( |
| 4106 | + 'cat_id' => $dbw->nextSequenceValue( 'category_cat_id_seq' ), |
| 4107 | + 'cat_title' => $cat |
| 4108 | + ); |
4109 | 4109 | } |
4110 | 4110 | $dbw->insert( 'category', $insertRows, __METHOD__, 'IGNORE' ); |
4111 | 4111 | |
— | — | @@ -4135,10 +4135,11 @@ |
4136 | 4136 | ); |
4137 | 4137 | } |
4138 | 4138 | } |
4139 | | - |
| 4139 | + |
4140 | 4140 | /** Lightweight method to get the parser output for a page, checking the parser cache |
4141 | | - * and so on. Doesn't consider most of the stuff that Article::view is forced to |
4142 | | - * consider, so it's not appropriate to use there. */ |
| 4141 | + * and so on. Doesn't consider most of the stuff that Article::view is forced to |
| 4142 | + * consider, so it's not appropriate to use there. |
| 4143 | + */ |
4143 | 4144 | function getParserOutput( $oldid = null ) { |
4144 | 4145 | global $wgEnableParserCache, $wgUser, $wgOut; |
4145 | 4146 | |
— | — | @@ -4146,8 +4147,8 @@ |
4147 | 4148 | $useParserCache = $wgEnableParserCache && |
4148 | 4149 | intval( $wgUser->getOption( 'stubthreshold' ) ) == 0 && |
4149 | 4150 | $this->exists() && |
4150 | | - $oldid === null; |
4151 | | - |
| 4151 | + $oldid === null; |
| 4152 | + |
4152 | 4153 | wfDebug( __METHOD__.': using parser cache: ' . ( $useParserCache ? 'yes' : 'no' ) . "\n" ); |
4153 | 4154 | if ( $wgUser->getOption( 'stubthreshold' ) ) { |
4154 | 4155 | wfIncrStats( 'pcache_miss_stub' ); |
— | — | @@ -4161,7 +4162,7 @@ |
4162 | 4163 | if ( $parserOutput === false ) { |
4163 | 4164 | // Cache miss; parse and output it. |
4164 | 4165 | $rev = Revision::newFromTitle( $this->getTitle(), $oldid ); |
4165 | | - |
| 4166 | + |
4166 | 4167 | return $this->getOutputFromWikitext( $rev->getText(), $useParserCache ); |
4167 | 4168 | } else { |
4168 | 4169 | return $parserOutput; |