Index: trunk/phase3/includes/api/ApiQueryRecentChanges.php |
— | — | @@ -43,7 +43,8 @@ |
44 | 44 | |
45 | 45 | private $fld_comment = false, $fld_parsedcomment = false, $fld_user = false, $fld_userid = false, |
46 | 46 | $fld_flags = false, $fld_timestamp = false, $fld_title = false, $fld_ids = false, |
47 | | - $fld_sizes = false, $fld_redirect = false, $fld_patrolled = false, $fld_loginfo = false, $fld_tags = false; |
| 47 | + $fld_sizes = false, $fld_redirect = false, $fld_patrolled = false, $fld_loginfo = false, |
| 48 | + $fld_tags = false, $token = array(); |
48 | 49 | |
49 | 50 | private $tokenFunctions; |
50 | 51 | |
Index: trunk/phase3/includes/api/ApiQueryRandom.php |
— | — | @@ -73,7 +73,11 @@ |
74 | 74 | } |
75 | 75 | } |
76 | 76 | |
77 | | - protected function runQuery( &$resultPageSet ) { |
| 77 | + /** |
| 78 | + * @param $resultPageSet ApiPageSet |
| 79 | + * @return int |
| 80 | + */ |
| 81 | + protected function runQuery( $resultPageSet = null ) { |
78 | 82 | $res = $this->select( __METHOD__ ); |
79 | 83 | $count = 0; |
80 | 84 | foreach ( $res as $row ) { |
Index: trunk/phase3/includes/api/ApiParse.php |
— | — | @@ -253,11 +253,11 @@ |
254 | 254 | if ( isset( $prop['headitems'] ) || isset( $prop['headhtml'] ) ) { |
255 | 255 | $out = new OutputPage; |
256 | 256 | $out->addParserOutputNoText( $p_result ); |
| 257 | + $userSkin = $wgUser->getSkin(); |
257 | 258 | |
258 | 259 | if ( isset( $prop['headitems'] ) ) { |
259 | 260 | $headItems = $this->formatHeadItems( $p_result->getHeadItems() ); |
260 | 261 | |
261 | | - $userSkin = $wgUser->getSkin(); |
262 | 262 | $userSkin->setupUserCss( $out ); |
263 | 263 | $css = $this->formatCss( $out->buildCssLinksArray() ); |
264 | 264 | |
Index: trunk/phase3/includes/api/ApiQueryBacklinks.php |
— | — | @@ -46,8 +46,18 @@ |
47 | 47 | |
48 | 48 | private $params, $contID, $redirID, $redirect; |
49 | 49 | private $bl_ns, $bl_from, $bl_table, $bl_code, $bl_title, $bl_sort, $bl_fields, $hasNS; |
50 | | - private $pageMap, $resultArr; |
51 | 50 | |
| 51 | + /** |
| 52 | + * Maps ns and title to pageid |
| 53 | + * |
| 54 | + * @var array |
| 55 | + */ |
| 56 | + private $pageMap = array(); |
| 57 | + private $resultArr; |
| 58 | + |
| 59 | + private $redirTitles = array(); |
| 60 | + private $continueStr = null; |
| 61 | + |
52 | 62 | // output element name, database column field prefix, database table |
53 | 63 | private $backlinksSettings = array( |
54 | 64 | 'backlinks' => array( |
— | — | @@ -232,9 +242,7 @@ |
233 | 243 | $res = $this->select( __METHOD__ . '::firstQuery' ); |
234 | 244 | |
235 | 245 | $count = 0; |
236 | | - $this->pageMap = array(); // Maps ns and title to pageid |
237 | | - $this->continueStr = null; |
238 | | - $this->redirTitles = array(); |
| 246 | + |
239 | 247 | foreach ( $res as $row ) { |
240 | 248 | if ( ++ $count > $this->params['limit'] ) { |
241 | 249 | // We've reached the one extra which shows that there are additional pages to be had. Stop here... |
Index: trunk/phase3/includes/api/ApiRollback.php |
— | — | @@ -38,8 +38,16 @@ |
39 | 39 | parent::__construct( $main, $action ); |
40 | 40 | } |
41 | 41 | |
42 | | - private $mTitleObj = null, $mUser = null; |
| 42 | + /** |
| 43 | + * @var Title |
| 44 | + */ |
| 45 | + private $mTitleObj = null; |
43 | 46 | |
| 47 | + /** |
| 48 | + * @var User |
| 49 | + */ |
| 50 | + private $mUser = null; |
| 51 | + |
44 | 52 | public function execute() { |
45 | 53 | $params = $this->extractRequestParams(); |
46 | 54 | |
Index: trunk/phase3/includes/api/ApiMain.php |
— | — | @@ -478,9 +478,7 @@ |
479 | 479 | } |
480 | 480 | |
481 | 481 | if ( $e instanceof UsageException ) { |
482 | | - // |
483 | 482 | // User entered incorrect parameters - print usage screen |
484 | | - // |
485 | 483 | $errMessage = $e->getMessageArray(); |
486 | 484 | |
487 | 485 | // Only print the help message when this is for the developer, not runtime |
— | — | @@ -490,9 +488,7 @@ |
491 | 489 | |
492 | 490 | } else { |
493 | 491 | global $wgShowSQLErrors, $wgShowExceptionDetails; |
494 | | - // |
495 | 492 | // Something is seriously wrong |
496 | | - // |
497 | 493 | if ( ( $e instanceof DBQueryError ) && !$wgShowSQLErrors ) { |
498 | 494 | $info = 'Database query error'; |
499 | 495 | } else { |
Index: trunk/phase3/includes/api/ApiPageSet.php |
— | — | @@ -684,7 +684,6 @@ |
685 | 685 | $titleWasConverted = $unconvertedTitle !== $titleObj->getPrefixedText(); |
686 | 686 | } |
687 | 687 | |
688 | | - |
689 | 688 | if ( $titleObj->getNamespace() < 0 ) { |
690 | 689 | // Handle Special and Media pages |
691 | 690 | $titleObj = $titleObj->fixSpecialName(); |
Index: trunk/phase3/includes/api/ApiBlock.php |
— | — | @@ -37,9 +37,6 @@ |
38 | 38 | */ |
39 | 39 | class ApiBlock extends ApiBase { |
40 | 40 | |
41 | | - /** |
42 | | - * Std ctor. |
43 | | - */ |
44 | 41 | public function __construct( $main, $action ) { |
45 | 42 | parent::__construct( $main, $action ); |
46 | 43 | } |
Index: trunk/phase3/includes/api/ApiQueryRevisions.php |
— | — | @@ -39,7 +39,7 @@ |
40 | 40 | class ApiQueryRevisions extends ApiQueryBase { |
41 | 41 | |
42 | 42 | private $diffto, $difftotext, $expandTemplates, $generateXML, $section, |
43 | | - $token; |
| 43 | + $token, $parseContent; |
44 | 44 | |
45 | 45 | public function __construct( $query, $moduleName ) { |
46 | 46 | parent::__construct( $query, $moduleName, 'rv' ); |
— | — | @@ -126,8 +126,7 @@ |
127 | 127 | $params['diffto'] = 0; |
128 | 128 | } |
129 | 129 | if ( ( !ctype_digit( $params['diffto'] ) || $params['diffto'] < 0 ) |
130 | | - && $params['diffto'] != 'prev' && $params['diffto'] != 'next' ) |
131 | | - { |
| 130 | + && $params['diffto'] != 'prev' && $params['diffto'] != 'next' ) { |
132 | 131 | $this->dieUsage( 'rvdiffto must be set to a non-negative number, "prev", "next" or "cur"', 'diffto' ); |
133 | 132 | } |
134 | 133 | // Check whether the revision exists and is readable, |
— | — | @@ -176,7 +175,6 @@ |
177 | 176 | $this->getResult()->setParsedLimit( $this->getModuleName(), $limit ); |
178 | 177 | } |
179 | 178 | |
180 | | - |
181 | 179 | if ( !is_null( $this->token ) || $pageCount > 0 ) { |
182 | 180 | $this->addFields( Revision::selectPageFields() ); |
183 | 181 | } |
— | — | @@ -234,7 +232,6 @@ |
235 | 233 | // Bug 24166 - API error when using rvprop=tags |
236 | 234 | $this->addTables( 'revision' ); |
237 | 235 | |
238 | | - |
239 | 236 | if ( $enumRevMode ) { |
240 | 237 | // This is mostly to prevent parameter errors (and optimize SQL?) |
241 | 238 | if ( !is_null( $params['startid'] ) && !is_null( $params['start'] ) ) { |
Index: trunk/phase3/includes/api/ApiQueryExternalLinks.php |
— | — | @@ -59,7 +59,7 @@ |
60 | 60 | $this->addTables( 'externallinks' ); |
61 | 61 | $this->addWhereFld( 'el_from', array_keys( $this->getPageSet()->getGoodTitles() ) ); |
62 | 62 | |
63 | | - //TODO: Refactor out,duplicated from ApiQueryExtLinksUsage |
| 63 | + //TODO: Refactor out, duplicated from ApiQueryExtLinksUsage |
64 | 64 | if ( !is_null( $query ) || $query != '' ) { |
65 | 65 | if ( is_null( $protocol ) ) { |
66 | 66 | $protocol = 'http://'; |
Index: trunk/phase3/includes/api/ApiBase.php |
— | — | @@ -403,6 +403,8 @@ |
404 | 404 | */ |
405 | 405 | public function makeHelpMsg_callback( $matches ) { |
406 | 406 | global $wgAutoloadClasses, $wgAutoloadLocalClasses; |
| 407 | + |
| 408 | + $file = ''; |
407 | 409 | if ( isset( $wgAutoloadLocalClasses[get_class( $this )] ) ) { |
408 | 410 | $file = $wgAutoloadLocalClasses[get_class( $this )]; |
409 | 411 | } elseif ( isset( $wgAutoloadClasses[get_class( $this )] ) ) { |
Index: trunk/phase3/includes/api/ApiQueryInfo.php |
— | — | @@ -41,6 +41,13 @@ |
42 | 42 | $fld_readable = false, $fld_watched = false, |
43 | 43 | $fld_preload = false, $fld_displaytitle = false; |
44 | 44 | |
| 45 | + private $params, $titles, $missing, $everything, $pageCounter; |
| 46 | + |
| 47 | + private $pageRestrictions, $pageIsRedir, $pageIsNew, $pageTouched, |
| 48 | + $pageLatest, $pageLength; |
| 49 | + |
| 50 | + private $protections, $watched, $talkids, $subjectids, $displaytitles; |
| 51 | + |
45 | 52 | private $tokenFunctions; |
46 | 53 | |
47 | 54 | public function __construct( $query, $moduleName ) { |