Merge "Using ULS in Special:PageLanguage"
[lhc/web/wiklou.git] / includes / deferred / LinksUpdate.php
index 65c04d6..45d2664 100644 (file)
@@ -31,7 +31,7 @@ class LinksUpdate extends SqlDataUpdate {
        /** @var int Page ID of the article linked from */
        public $mId;
 
-       /** @var Title object of the article linked from */
+       /** @var Title Title object of the article linked from */
        public $mTitle;
 
        /** @var ParserOutput */
@@ -52,7 +52,7 @@ class LinksUpdate extends SqlDataUpdate {
        /** @var array Map of category names to sort keys */
        public $mCategories;
 
-       /** @var array ap of language codes to titles */
+       /** @var array Map of language codes to titles */
        public $mInterlangs;
 
        /** @var array Map of arbitrary name to value */
@@ -269,7 +269,7 @@ class LinksUpdate extends SqlDataUpdate {
        }
 
        /**
-        * @param $cats
+        * @param array $cats
         */
        function invalidateCategories( $cats ) {
                $this->invalidatePages( NS_CATEGORY, array_keys( $cats ) );
@@ -288,7 +288,7 @@ class LinksUpdate extends SqlDataUpdate {
        }
 
        /**
-        * @param $images
+        * @param array $images
         */
        function invalidateImageDescriptions( $images ) {
                $this->invalidatePages( NS_FILE, array_keys( $images ) );
@@ -329,7 +329,7 @@ class LinksUpdate extends SqlDataUpdate {
                                $toField = $prefix . '_to';
                        }
                        if ( count( $deletions ) ) {
-                               $where[] = "$toField IN (" . $this->mDb->makeList( array_keys( $deletions ) ) . ')';
+                               $where[$toField] = array_keys( $deletions );
                        } else {
                                $where = false;
                        }
@@ -358,6 +358,7 @@ class LinksUpdate extends SqlDataUpdate {
                        foreach ( $diffs as $dbk => $id ) {
                                $arr[] = array(
                                        'pl_from' => $this->mId,
+                                       'pl_from_namespace' => $this->mTitle->getNamespace(),
                                        'pl_namespace' => $ns,
                                        'pl_title' => $dbk
                                );
@@ -379,6 +380,7 @@ class LinksUpdate extends SqlDataUpdate {
                        foreach ( $diffs as $dbk => $id ) {
                                $arr[] = array(
                                        'tl_from' => $this->mId,
+                                       'tl_from_namespace' => $this->mTitle->getNamespace(),
                                        'tl_namespace' => $ns,
                                        'tl_title' => $dbk
                                );
@@ -400,6 +402,7 @@ class LinksUpdate extends SqlDataUpdate {
                foreach ( $diffs as $iname => $dummy ) {
                        $arr[] = array(
                                'il_from' => $this->mId,
+                               'il_from_namespace' => $this->mTitle->getNamespace(),
                                'il_to' => $iname
                        );
                }
@@ -432,7 +435,7 @@ class LinksUpdate extends SqlDataUpdate {
        /**
         * Get an array of category insertions
         *
-        * @param array $existing mapping existing category names to sort keys. If both
+        * @param array $existing Mapping existing category names to sort keys. If both
         * match a link in $this, the link will be omitted from the output
         *
         * @return array
@@ -477,7 +480,7 @@ class LinksUpdate extends SqlDataUpdate {
        /**
         * Get an array of interlanguage link insertions
         *
-        * @param array $existing mapping existing language codes to titles
+        * @param array $existing Mapping existing language codes to titles
         *
         * @return array
         */
@@ -521,7 +524,7 @@ class LinksUpdate extends SqlDataUpdate {
         * is present in the database (as indicated by $wgPagePropsHaveSortkey).
         * The sortkey value is currently determined by getPropertySortKeyValue().
         *
-        * @note: this assumes that $this->mProperties[$prop] is defined.
+        * @note this assumes that $this->mProperties[$prop] is defined.
         *
         * @param string $prop The name of the property.
         *
@@ -550,8 +553,8 @@ class LinksUpdate extends SqlDataUpdate {
         * This will return $value if it is a float or int,
         * 1 or resp. 0 if it is a bool, and null otherwise.
         *
-        * @note: In the future, we may allow the sortkey to be specified explicitly
-        *        in ParserOutput::setProperty.
+        * @note In the future, we may allow the sortkey to be specified explicitly
+        *       in ParserOutput::setProperty.
         *
         * @param mixed $value
         *
@@ -820,7 +823,7 @@ class LinksUpdate extends SqlDataUpdate {
        /**
         * Get an array of existing categories, with the name in the key and sort key in the value.
         *
-        * @return array of property names and values
+        * @return array Array of property names and values
         */
        private function getExistingProperties() {
                $res = $this->mDb->select( 'page_props', array( 'pp_propname', 'pp_value' ),
@@ -882,7 +885,7 @@ class LinksUpdate extends SqlDataUpdate {
        /**
         * Fetch page links added by this LinksUpdate.  Only available after the update is complete.
         * @since 1.22
-        * @return null|array of Titles
+        * @return null|array Array of Titles
         */
        public function getAddedLinks() {
                if ( $this->linkInsertions === null ) {
@@ -899,7 +902,7 @@ class LinksUpdate extends SqlDataUpdate {
        /**
         * Fetch page links removed by this LinksUpdate.  Only available after the update is complete.
         * @since 1.22
-        * @return null|array of Titles
+        * @return null|array Array of Titles
         */
        public function getRemovedLinks() {
                if ( $this->linkDeletions === null ) {