<?php
-
/**
* This class stores an arbitrary value along with its dependencies.
* Users should typically only use DependencyWrapper::getFromCache(), rather
/**
* Hook to perform any expensive pre-serialize loading of dependency values.
*/
- function loadDependencyValues() {}
+ function loadDependencyValues() { }
}
/**
function isExpired() {
$touched = $this->getTitle()->getTouched();
+
if ( $this->touched === false ) {
if ( $touched === false ) {
# Still missing
function calculateTimestamps() {
# Initialise values to false
$timestamps = array();
+
foreach ( $this->getLinkBatch()->data as $ns => $dbks ) {
if ( count( $dbks ) > 0 ) {
$timestamps[$ns] = array();
if ( count( $timestamps ) ) {
$dbr = wfGetDB( DB_SLAVE );
$where = $this->getLinkBatch()->constructSet( 'page', $dbr );
- $res = $dbr->select( 'page',
+ $res = $dbr->select(
+ 'page',
array( 'page_namespace', 'page_title', 'page_touched' ),
- $where, __METHOD__ );
+ $where,
+ __METHOD__
+ );
+
while ( $row = $dbr->fetchObject( $res ) ) {
$timestamps[$row->page_namespace][$row->page_title] = $row->page_touched;
}
}
function getLinkBatch() {
- if ( !isset( $this->linkBatch ) ){
+ if ( !isset( $this->linkBatch ) ) {
$this->linkBatch = new LinkBatch;
$this->linkBatch->setArray( $this->timestamps );
}
foreach ( $this->timestamps as $ns => $dbks ) {
foreach ( $dbks as $dbk => $oldTimestamp ) {
$newTimestamp = $newTimestamps[$ns][$dbk];
+
if ( $oldTimestamp === false ) {
if ( $newTimestamp === false ) {
# Still missing