- function getGoodAdditions()
- {
- return array_diff( $this->mGoodLinks, $this->mOldGoodLinks );
- }
-
- function getBadAdditions()
- {
- #wfDebug( "mOldBadLinks: " . implode( ', ', array_keys( $this->mOldBadLinks ) ) . "\n" );
- #wfDebug( "mBadLinks: " . implode( ', ', array_keys( $this->mBadLinks ) ) . "\n" );
- return array_values( array_diff( array_keys( $this->mBadLinks ), array_keys( $this->mOldBadLinks ) ) );
- }
-
- function getImageAdditions()
- {
- return array_diff_assoc( $this->mImageLinks, $this->mOldImageLinks );
- }
-
- function getGoodDeletions()
- {
- return array_diff( $this->mOldGoodLinks, $this->mGoodLinks );
- }
-
- function getBadDeletions()
- {
- return array_values( array_diff( array_keys( $this->mOldBadLinks ), array_keys( $this->mBadLinks ) ));
- }
-
- function getImageDeletions()
- {
- return array_diff_assoc( $this->mOldImageLinks, $this->mImageLinks );
- }
-
- # Parameters: $which is one of the LINKCACHE_xxx constants, $del and $add are
- # the incremental update arrays which will be filled. Returns whether or not it's
- # worth doing the incremental version. For example, if [[List of mathematical topics]]
- # was blanked, it would take a long, long time to do incrementally.
- function incrementalSetup( $which, &$del, &$add )
- {
- if ( ! $this->mPreFilled ) {
- return false;
- }
-
- switch ( $which ) {
- case LINKCACHE_GOOD:
- $old =& $this->mOldGoodLinks;
- $cur =& $this->mGoodLinks;
- $del = $this->getGoodDeletions();
- $add = $this->getGoodAdditions();
- break;
- case LINKCACHE_BAD:
- $old =& $this->mOldBadLinks;
- $cur =& $this->mBadLinks;
- $del = $this->getBadDeletions();
- $add = $this->getBadAdditions();
- break;
- default: # LINKCACHE_IMAGE
- return false;
- }
-
- return true;
- }
-
- # Clears cache but leaves old preFill copies alone
- function clear()
- {