Index: trunk/phase3/includes/LinksUpdate.php |
— | — | @@ -97,11 +97,13 @@ |
98 | 98 | |
99 | 99 | # Image links |
100 | 100 | $existing = $this->getExistingImages(); |
101 | | - $this->incrTableUpdate( 'imagelinks', 'il', $this->getImageDeletions( $existing ), |
102 | | - $this->getImageInsertions( $existing ) ); |
103 | 101 | |
| 102 | + $imageDeletes = $this->getImageDeletions( $existing ); |
| 103 | + $imageInserts = $this->getImageInsertions( $existing ); |
| 104 | + $this->incrTableUpdate( 'imagelinks', 'il', $imageDeletes, $imageInserts ); |
| 105 | + |
104 | 106 | # Invalidate all image description pages which had links added or removed |
105 | | - $imageUpdates = array_diff_key( $existing, $this->mImages ) + array_diff_key( $this->mImages, $existing ); |
| 107 | + $imageUpdates = $imageDeletions + $imageInsertions |
106 | 108 | $this->invalidateImageDescriptions( $imageUpdates ); |
107 | 109 | |
108 | 110 | # External links |
— | — | @@ -121,23 +123,27 @@ |
122 | 124 | |
123 | 125 | # Category links |
124 | 126 | $existing = $this->getExistingCategories(); |
125 | | - $this->incrTableUpdate( 'categorylinks', 'cl', $this->getCategoryDeletions( $existing ), |
126 | | - $this->getCategoryInsertions( $existing ) ); |
127 | 127 | |
| 128 | + $categoryDeletes = $this->getCategoryDeletions( $existing ); |
| 129 | + $categoryInserts = $this->getCategoryInsertions( $existing ); |
| 130 | + |
| 131 | + $this->incrTableUpdate( 'categorylinks', 'cl', $categoryDeletes, $categoryInserts ); |
| 132 | + |
128 | 133 | # Invalidate all categories which were added, deleted or changed (set symmetric difference) |
129 | | - $categoryInserts = array_diff_assoc( $this->mCategories, $existing ); |
130 | | - $categoryDeletes = array_diff_assoc( $existing, $this->mCategories ); |
131 | 134 | $categoryUpdates = $categoryInserts + $categoryDeletes; |
132 | 135 | $this->invalidateCategories( $categoryUpdates ); |
133 | 136 | $this->updateCategoryCounts( $categoryInserts, $categoryDeletes ); |
134 | 137 | |
135 | 138 | # Page properties |
136 | 139 | $existing = $this->getExistingProperties(); |
137 | | - $this->incrTableUpdate( 'page_props', 'pp', $this->getPropertyDeletions( $existing ), |
138 | | - $this->getPropertyInsertions( $existing ) ); |
139 | 140 | |
| 141 | + $propertiesDeletes = $this->getPropertiesDeletions( $existing ); |
| 142 | + $propertiesInserts = $this->getPropertiesInsertions( $existing ); |
| 143 | + |
| 144 | + $this->incrTableUpdate( 'page_props', 'pp', $propertiesDeletes, $propertiesInserts ); |
| 145 | + |
140 | 146 | # Invalidate the necessary pages |
141 | | - $changed = array_diff_assoc( $existing, $this->mProperties ) + array_diff_assoc( $this->mProperties, $existing ); |
| 147 | + $changed = $propertiesDeletes + $propertiesInserts; |
142 | 148 | $this->invalidateProperties( $changed ); |
143 | 149 | |
144 | 150 | # Refresh links of all pages including this page |