Added 'fromdbmaster' param option to WikiPage::loadPageData()
[lhc/web/wiklou.git] / includes / LinksUpdate.php
index b86ea56..7b85040 100644 (file)
@@ -2,6 +2,21 @@
 /**
  * See docs/deferred.txt
  *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
  * @todo document (e.g. one-sentence top-level class description).
  */
 class LinksUpdate {
@@ -67,7 +82,7 @@ class LinksUpdate {
                        $this->mInterlangs[$key] = $title;
                }
 
-               foreach ( $this->mCategories as $cat => &$sortkey ) {
+               foreach ( $this->mCategories as &$sortkey ) {
                        # If the sortkey is longer then 255 bytes,
                        # it truncated by DB, and then doesn't get
                        # matched when comparing existing vs current
@@ -110,7 +125,8 @@ class LinksUpdate {
                $existing = $this->getExistingImages();
 
                $imageDeletes = $this->getImageDeletions( $existing );
-               $this->incrTableUpdate( 'imagelinks', 'il', $imageDeletes, $this->getImageInsertions( $existing ) );
+               $this->incrTableUpdate( 'imagelinks', 'il', $imageDeletes,
+                       $this->getImageInsertions( $existing ) );
 
                # Invalidate all image description pages which had links added or removed
                $imageUpdates = $imageDeletes + array_diff_key( $this->mImages, $existing );
@@ -141,7 +157,8 @@ class LinksUpdate {
 
                $categoryDeletes = $this->getCategoryDeletions( $existing );
 
-               $this->incrTableUpdate( 'categorylinks', 'cl', $categoryDeletes, $this->getCategoryInsertions( $existing ) );
+               $this->incrTableUpdate( 'categorylinks', 'cl', $categoryDeletes,
+                       $this->getCategoryInsertions( $existing ) );
 
                # Invalidate all categories which were added, deleted or changed (set symmetric difference)
                $categoryInserts = array_diff_assoc( $this->mCategories, $existing );
@@ -154,7 +171,8 @@ class LinksUpdate {
 
                $propertiesDeletes = $this->getPropertyDeletions( $existing );
 
-               $this->incrTableUpdate( 'page_props', 'pp', $propertiesDeletes, $this->getPropertyInsertions( $existing ) );
+               $this->incrTableUpdate( 'page_props', 'pp', $propertiesDeletes,
+                       $this->getPropertyInsertions( $existing ) );
 
                # Invalidate the necessary pages
                $changed = $propertiesDeletes + array_diff_assoc( $this->mProperties, $existing );
@@ -362,7 +380,9 @@ class LinksUpdate {
        function getLinkInsertions( $existing = array() ) {
                $arr = array();
                foreach( $this->mLinks as $ns => $dbkeys ) {
-                       $diffs = isset( $existing[$ns] ) ? array_diff_key( $dbkeys, $existing[$ns] ) : $dbkeys;
+                       $diffs = isset( $existing[$ns] )
+                               ? array_diff_key( $dbkeys, $existing[$ns] )
+                               : $dbkeys;
                        foreach ( $diffs as $dbk => $id ) {
                                $arr[] = array(
                                        'pl_from'      => $this->mId,
@@ -749,7 +769,7 @@ class LinksUpdate {
        function getTitle() {
                return $this->mTitle;
        }
-       
+
        /**
         * Return the list of images used as generated by the parser
         */