From: Aaron Schulz Date: Tue, 12 Apr 2011 20:21:16 +0000 (+0000) Subject: * Made pageDataFromTitle protected (unused elsewhere) X-Git-Tag: 1.31.0-rc.0~30892 X-Git-Url: http://git.cyclocoop.org/data/%24self?a=commitdiff_plain;h=b7bcf1b49855760d6ada156ae4cd261ee9c12381;p=lhc%2Fweb%2Fwiklou.git * Made pageDataFromTitle protected (unused elsewhere) * Split out selectFields() for easier use of loadPageData() * Marked Revision::selectFields as public (was used as such) --- diff --git a/includes/Article.php b/includes/Article.php index 7bacc8a778..0b459f1564 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -400,6 +400,26 @@ class Article { wfProfileOut( __METHOD__ ); } + /** + * Return the list of revision fields that should be selected to create + * a new page. + */ + public static function selectFields() { + return array( + 'page_id', + 'page_namespace', + 'page_title', + 'page_restrictions', + 'page_counter', + 'page_is_redirect', + 'page_is_new', + 'page_random', + 'page_touched', + 'page_latest', + 'page_len', + ); + } + /** * Fetch a page record with the given conditions * @param $dbr Database object @@ -407,19 +427,7 @@ class Article { * @return mixed Database result resource, or false on failure */ protected function pageData( $dbr, $conditions ) { - $fields = array( - 'page_id', - 'page_namespace', - 'page_title', - 'page_restrictions', - 'page_counter', - 'page_is_redirect', - 'page_is_new', - 'page_random', - 'page_touched', - 'page_latest', - 'page_len', - ); + $fields = self::selectFields(); wfRunHooks( 'ArticlePageDataBefore', array( &$this, &$fields ) ); @@ -438,7 +446,7 @@ class Article { * @param $title Title object * @return mixed Database result resource, or false on failure */ - public function pageDataFromTitle( $dbr, $title ) { + protected function pageDataFromTitle( $dbr, $title ) { return $this->pageData( $dbr, array( 'page_namespace' => $title->getNamespace(), 'page_title' => $title->getDBkey() ) ); diff --git a/includes/Revision.php b/includes/Revision.php index 5c2dda0ff8..0335ab1c85 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -249,7 +249,7 @@ class Revision { * Return the list of revision fields that should be selected to create * a new revision. */ - static function selectFields() { + public static function selectFields() { return array( 'rev_id', 'rev_page',