<?php
+/**
+ * Old file in the in the oldimage table
+ *
+ * @file
+ * @ingroup FileRepo
+ */
/**
* Class to represent a file in the oldimage table
}
static function newFromKey( $sha1, $repo, $timestamp = false ) {
- # Polymorphic function name to distinguish foreign and local fetches
- $fname = get_class( $this ) . '::' . __FUNCTION__;
-
$conds = array( 'oi_sha1' => $sha1 );
if( $timestamp ) {
$conds['oi_timestamp'] = $timestamp;
}
- $row = $dbr->selectRow( 'oldimage', $this->getCacheFields( 'oi_' ), $conds, $fname );
+ $dbr = $repo->getSlaveDB();
+ $row = $dbr->selectRow( 'oldimage', self::selectFields(), $conds, __METHOD__ );
if( $row ) {
return self::newFromRow( $row, $repo );
} else {
}
/**
- * @param Title $title
- * @param FileRepo $repo
- * @param string $time Timestamp or null to load by archive name
- * @param string $archiveName Archive name or null to load by timestamp
+ * @param $title Title
+ * @param $repo FileRepo
+ * @param $time String: timestamp or null to load by archive name
+ * @param $archiveName String: archive name or null to load by timestamp
*/
function __construct( $title, $repo, $time, $archiveName ) {
parent::__construct( $title, $repo );
}
function getUrlRel() {
- return 'archive/' . $this->getHashPath() . urlencode( $this->getArchiveName() );
+ return 'archive/' . $this->getHashPath() . rawurlencode( $this->getArchiveName() );
}
function upgradeRow() {
}
/**
- * int $field one of DELETED_* bitfield constants
- * for file or revision rows
+ * @param $field Integer: one of DELETED_* bitfield constants
+ * for file or revision rows
* @return bool
*/
function isDeleted( $field ) {
/**
* Determine if the current user is allowed to view a particular
* field of this image file, if it's marked as deleted.
- * @param int $field
+ *
+ * @param $field Integer
* @return bool
*/
function userCan( $field ) {