X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2FLinksUpdate.php;h=7b85040c015be41865f57e68e0fb6d6bcebdfe79;hb=7f0b8463c8e1834c2dd5bef7d0dd34d7d1064d9b;hp=b86ea56581153e2d7cc693a57394a2d03194d221;hpb=13bb571b11663aaa51c28e39ae345ac1bafd8e06;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/LinksUpdate.php b/includes/LinksUpdate.php index b86ea56581..7b85040c01 100644 --- a/includes/LinksUpdate.php +++ b/includes/LinksUpdate.php @@ -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 */