Index: trunk/phase3/includes/Article.php |
— | — | @@ -401,25 +401,33 @@ |
402 | 402 | } |
403 | 403 | |
404 | 404 | /** |
| 405 | + * Return the list of revision fields that should be selected to create |
| 406 | + * a new page. |
| 407 | + */ |
| 408 | + public static function selectFields() { |
| 409 | + return array( |
| 410 | + 'page_id', |
| 411 | + 'page_namespace', |
| 412 | + 'page_title', |
| 413 | + 'page_restrictions', |
| 414 | + 'page_counter', |
| 415 | + 'page_is_redirect', |
| 416 | + 'page_is_new', |
| 417 | + 'page_random', |
| 418 | + 'page_touched', |
| 419 | + 'page_latest', |
| 420 | + 'page_len', |
| 421 | + ); |
| 422 | + } |
| 423 | + |
| 424 | + /** |
405 | 425 | * Fetch a page record with the given conditions |
406 | 426 | * @param $dbr Database object |
407 | 427 | * @param $conditions Array |
408 | 428 | * @return mixed Database result resource, or false on failure |
409 | 429 | */ |
410 | 430 | protected function pageData( $dbr, $conditions ) { |
411 | | - $fields = array( |
412 | | - 'page_id', |
413 | | - 'page_namespace', |
414 | | - 'page_title', |
415 | | - 'page_restrictions', |
416 | | - 'page_counter', |
417 | | - 'page_is_redirect', |
418 | | - 'page_is_new', |
419 | | - 'page_random', |
420 | | - 'page_touched', |
421 | | - 'page_latest', |
422 | | - 'page_len', |
423 | | - ); |
| 431 | + $fields = self::selectFields(); |
424 | 432 | |
425 | 433 | wfRunHooks( 'ArticlePageDataBefore', array( &$this, &$fields ) ); |
426 | 434 | |
— | — | @@ -438,7 +446,7 @@ |
439 | 447 | * @param $title Title object |
440 | 448 | * @return mixed Database result resource, or false on failure |
441 | 449 | */ |
442 | | - public function pageDataFromTitle( $dbr, $title ) { |
| 450 | + protected function pageDataFromTitle( $dbr, $title ) { |
443 | 451 | return $this->pageData( $dbr, array( |
444 | 452 | 'page_namespace' => $title->getNamespace(), |
445 | 453 | 'page_title' => $title->getDBkey() ) ); |
Index: trunk/phase3/includes/Revision.php |
— | — | @@ -249,7 +249,7 @@ |
250 | 250 | * Return the list of revision fields that should be selected to create |
251 | 251 | * a new revision. |
252 | 252 | */ |
253 | | - static function selectFields() { |
| 253 | + public static function selectFields() { |
254 | 254 | return array( |
255 | 255 | 'rev_id', |
256 | 256 | 'rev_page', |