X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fcache%2FLinkBatch.php;h=48c063f4e5849d4beeb5a172030fc62a144ff362;hb=00a57c77e31755e2c365a57118bd6ceca7507e3d;hp=1a20ab4f4f959686fefdf6210abd792c7be78225;hpb=83a1cf573f7439e45d292a072472ac49212c9ffb;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/cache/LinkBatch.php b/includes/cache/LinkBatch.php index 1a20ab4f4f..48c063f4e5 100644 --- a/includes/cache/LinkBatch.php +++ b/includes/cache/LinkBatch.php @@ -49,14 +49,14 @@ class LinkBatch { * class. Only used in debugging output. * @since 1.17 * - * @param $caller + * @param string $caller */ public function setCaller( $caller ) { $this->caller = $caller; } /** - * @param $title Title + * @param Title $title */ public function addObj( $title ) { if ( is_object( $title ) ) { @@ -67,9 +67,8 @@ class LinkBatch { } /** - * @param $ns int - * @param $dbkey string - * @return mixed + * @param int $ns + * @param string $dbkey */ public function add( $ns, $dbkey ) { if ( $ns < 0 ) { @@ -86,7 +85,7 @@ class LinkBatch { * Set the link list to a given 2-d array * First key is the namespace, second is the DB key, value arbitrary * - * @param $array array + * @param array $array */ public function setArray( $array ) { $this->data = $array; @@ -113,7 +112,7 @@ class LinkBatch { /** * Do the query and add the results to the LinkCache object * - * @return Array mapping PDBK to ID + * @return array Mapping PDBK to ID */ public function execute() { $linkCache = LinkCache::singleton(); @@ -125,8 +124,8 @@ class LinkBatch { * Do the query and add the results to a given LinkCache object * Return an array mapping PDBK to ID * - * @param $cache LinkCache - * @return Array remaining IDs + * @param LinkCache $cache + * @return array Remaining IDs */ protected function executeInto( &$cache ) { wfProfileIn( __METHOD__ ); @@ -144,9 +143,9 @@ class LinkBatch { * This function *also* stores extra fields of the title used for link * parsing to avoid extra DB queries. * - * @param $cache LinkCache - * @param $res - * @return Array of remaining titles + * @param LinkCache $cache + * @param ResultWrapper $res + * @return array Array of remaining titles */ public function addResultToCache( $cache, $res ) { if ( !$res ) { @@ -178,9 +177,11 @@ class LinkBatch { /** * Perform the existence test query, return a ResultWrapper with page_id fields - * @return Bool|ResultWrapper + * @return bool|ResultWrapper */ public function doQuery() { + global $wgContentHandlerUseDB; + if ( $this->isEmpty() ) { return false; } @@ -191,6 +192,11 @@ class LinkBatch { $table = 'page'; $fields = array( 'page_id', 'page_namespace', 'page_title', 'page_len', 'page_is_redirect', 'page_latest' ); + + if ( $wgContentHandlerUseDB ) { + $fields[] = 'page_content_model'; + } + $conds = $this->constructSet( 'page', $dbr ); // Do query @@ -207,7 +213,7 @@ class LinkBatch { /** * Do (and cache) {{GENDER:...}} information for userpages in this LinkBatch * - * @return bool whether the query was successful + * @return bool Whether the query was successful */ public function doGenderQuery() { if ( $this->isEmpty() ) { @@ -228,9 +234,9 @@ class LinkBatch { /** * Construct a WHERE clause which will match all the given titles. * - * @param string $prefix the appropriate table's field name prefix ('page', 'pl', etc) - * @param $db DatabaseBase object to use - * @return mixed string with SQL where clause fragment, or false if no items. + * @param string $prefix The appropriate table's field name prefix ('page', 'pl', etc) + * @param DatabaseBase $db DatabaseBase object to use + * @return string|bool String with SQL where clause fragment, or false if no items. */ public function constructSet( $prefix, $db ) { return $db->makeWhereFrom2d( $this->data, "{$prefix}_namespace", "{$prefix}_title" );