if ( $res->numRows() > 0 ) {
foreach ( $res as $row ) {
- // $data[] = Title::newFromText($wgContLang->getNSText ( NS_CATEGORY ).':'.$row->cl_to);
- $data[$wgContLang->getNSText( NS_CATEGORY ) . ':' . $row->cl_to] = $this->getFullText();
+ // $data[] = Title::newFromText($wgContLang->getNsText ( NS_CATEGORY ).':'.$row->cl_to);
+ $data[$wgContLang->getNsText( NS_CATEGORY ) . ':' . $row->cl_to] = $this->getFullText();
}
}
return $data;
*/
public function invalidateCache() {
global $wgMemc;
+
if ( wfReadOnly() ) {
return false;
}
+
$dbw = wfGetDB( DB_MASTER );
- $success = $dbw->update(
- 'page',
- array( 'page_touched' => $dbw->timestamp() ),
- $this->pageCond(),
- __METHOD__
- );
+ $conds = $this->pageCond();
+ $dbw->onTransactionIdle( function() use ( $dbw, $conds ) {
+ $dbw->update(
+ 'page',
+ array( 'page_touched' => $dbw->timestamp() ),
+ $conds,
+ __METHOD__
+ );
+ } );
HTMLFileCache::clearFileCache( $this );
// Clear page info.
$revision = WikiPage::factory( $this )->getRevision();
- if( $revision !== null ) {
+ if ( $revision !== null ) {
$memcKey = wfMemcKey( 'infoaction', $this->getPrefixedText(), $revision->getId() );
- $success = $success && $wgMemc->delete( $memcKey );
+ $success = $wgMemc->delete( $memcKey );
+ } else {
+ $success = true;
}
return $success;