}
/**
- * @param DatabaseBase $dbr
+ * @param IDatabase $dbr
* @param string|array $condition
* @return bool|ResultWrapper
*/
protected static function listPages( $dbr, $condition ) {
- return $dbr->resultObject( $dbr->select(
+ return $dbr->select(
array( 'archive' ),
array(
'ar_namespace',
'ORDER BY' => array( 'ar_namespace', 'ar_title' ),
'LIMIT' => 100,
)
- ) );
+ );
}
/**
$options
);
- $res = $dbr->select( $tables,
+ return $dbr->select( $tables,
$fields,
$conds,
__METHOD__,
$options,
$join_conds
);
-
- return $dbr->resultObject( $res );
}
/**
}
$dbr = wfGetDB( DB_SLAVE );
- $res = $dbr->select(
+ return $dbr->select(
'filearchive',
ArchivedFile::selectFields(),
array( 'fa_name' => $this->title->getDBkey() ),
__METHOD__,
array( 'ORDER BY' => 'fa_timestamp DESC' )
);
-
- return $dbr->resultObject( $res );
}
/**
$logEntry->setTarget( $this->title );
$logEntry->setComment( $reason );
- wfRunHooks( 'ArticleUndeleteLogEntry', array( $this, &$logEntry, $user ) );
+ Hooks::run( 'ArticleUndeleteLogEntry', array( $this, &$logEntry, $user ) );
$logid = $logEntry->insert();
$logEntry->publish( $logid );
__METHOD__,
/* options */ array( 'ORDER BY' => 'ar_timestamp' )
);
- $ret = $dbw->resultObject( $result );
- $rev_count = $dbw->numRows( $result );
+ $rev_count = $result->numRows();
if ( !$rev_count ) {
wfDebug( __METHOD__ . ": no revisions to restore\n" );
return $status;
}
- $ret->seek( $rev_count - 1 ); // move to last
- $row = $ret->fetchObject(); // get newest archived rev
+ $result->seek( $rev_count - 1 ); // move to last
+ $row = $result->fetchObject(); // get newest archived rev
$oldPageId = (int)$row->ar_page_id; // pass this to ArticleUndelete hook
- $ret->seek( 0 ); // move back
+ $result->seek( 0 ); // move back
// grab the content to check consistency with global state before restoring the page.
$revision = Revision::newFromArchiveRow( $row,
$revision = null;
$restored = 0;
- foreach ( $ret as $row ) {
+ foreach ( $result as $row ) {
// Check for key dupes due to shitty archive integrity.
if ( $row->ar_rev_id ) {
$exists = $dbw->selectField( 'revision', '1',
$revision->insertOn( $dbw );
$restored++;
- wfRunHooks( 'ArticleRevisionUndeleted', array( &$this->title, $revision, $row->ar_page_id ) );
+ Hooks::run( 'ArticleRevisionUndeleted', array( &$this->title, $revision, $row->ar_page_id ) );
}
# Now that it's safely stored, take it out of the archive
$dbw->delete( 'archive',
);
}
- wfRunHooks( 'ArticleUndelete', array( &$this->title, $created, $comment, $oldPageId ) );
+ Hooks::run( 'ArticleUndelete', array( &$this->title, $created, $comment, $oldPageId ) );
if ( $this->title->getNamespace() == NS_FILE ) {
$update = new HTMLCacheUpdate( $this->title, 'imagelinks' );
}
$archive = new PageArchive( $this->mTargetObj, $this->getConfig() );
- if ( !wfRunHooks( 'UndeleteForm::showRevision', array( &$archive, $this->mTargetObj ) ) ) {
+ if ( !Hooks::run( 'UndeleteForm::showRevision', array( &$archive, $this->mTargetObj ) ) ) {
return;
}
$rev = $archive->getRevision( $timestamp );
$out->addHTML( $this->msg( 'undelete-revision' )->rawParams( $link )->params(
$time )->rawParams( $userLink )->params( $d, $t )->parse() . '</div>' );
- if ( !wfRunHooks( 'UndeleteShowRevision', array( $this->mTargetObj, $rev ) ) ) {
+ if ( !Hooks::run( 'UndeleteShowRevision', array( $this->mTargetObj, $rev ) ) ) {
return;
}
);
$archive = new PageArchive( $this->mTargetObj, $this->getConfig() );
- wfRunHooks( 'UndeleteForm::showHistory', array( &$archive, $this->mTargetObj ) );
+ Hooks::run( 'UndeleteForm::showHistory', array( &$archive, $this->mTargetObj ) );
/*
$text = $archive->getLastRevisionText();
if( is_null( $text ) ) {
}
function undelete() {
- if ( $this->getConfig()->get( 'UploadMaintenance' ) && $this->mTargetObj->getNamespace() == NS_FILE ) {
+ if ( $this->getConfig()->get( 'UploadMaintenance' )
+ && $this->mTargetObj->getNamespace() == NS_FILE
+ ) {
throw new ErrorPageError( 'undelete-error', 'filedelete-maintenance' );
}
$out = $this->getOutput();
$archive = new PageArchive( $this->mTargetObj, $this->getConfig() );
- wfRunHooks( 'UndeleteForm::undelete', array( &$archive, $this->mTargetObj ) );
+ Hooks::run( 'UndeleteForm::undelete', array( &$archive, $this->mTargetObj ) );
$ok = $archive->undelete(
$this->mTargetTimestamp,
$this->mComment,
if ( is_array( $ok ) ) {
if ( $ok[1] ) { // Undeleted file count
- wfRunHooks( 'FileUndeleteComplete', array(
+ Hooks::run( 'FileUndeleteComplete', array(
$this->mTargetObj, $this->mFileVersions,
$this->getUser(), $this->mComment ) );
}