*
* @ingroup FileAbstraction
*/
-abstract class File {
+abstract class File implements IDBAccessObject {
// Bitfield values akin to the Revision deletion constants
const DELETED_FILE = 1;
const DELETED_COMMENT = 2;
return false;
}
+ /**
+ * Load any lazy-loaded file object fields from source
+ *
+ * This is only useful when setting $flags
+ *
+ * Overridden by LocalFile to actually query the DB
+ *
+ * @param integer $flags Bitfield of File::READ_* constants
+ */
+ public function load( $flags = 0 ) {
+ }
+
/**
* Returns true if file exists in the repository.
*
}
/**
+ * @param bool|IContextSource $context Context to use (optional)
* @return bool
*/
- function formatMetadata() {
+ function formatMetadata( $context = false ) {
if ( !$this->getHandler() ) {
return false;
}
- return $this->getHandler()->formatMetadata( $this, $this->getMetadata() );
+ return $this->getHandler()->formatMetadata( $this, $context );
}
/**
wfDebug( "miss\n" );
}
wfDebug( "Fetching shared description from $renderUrl\n" );
- $res = Http::get( $renderUrl );
+ $res = Http::get( $renderUrl, array(), __METHOD__ );
if ( $res && $this->repo->descriptionCacheExpiry > 0 ) {
$wgMemc->set( $key, $res, $this->repo->descriptionCacheExpiry );
}
return $this->repo->getFileTimestamp( $this->getPath() );
}
+ /**
+ * Returns the timestamp (in TS_MW format) of the last change of the description page.
+ * Returns false if the file does not have a description page, or retrieving the timestamp
+ * would be expensive.
+ * @since 1.25
+ * @return string|bool
+ */
+ public function getDescriptionTouched() {
+ return false;
+ }
+
/**
* Get the SHA-1 base 36 hash of the file
*
if ( $wgShowEXIF && $this->displayImg->exists() ) {
// @todo FIXME: Bad interface, see note on MediaHandler::formatMetadata().
- $formattedMetadata = $this->displayImg->formatMetadata();
+ $formattedMetadata = $this->displayImg->formatMetadata( $this->getContext() );
$showmeta = $formattedMetadata !== false;
} else {
$showmeta = false;
} else {
if ( $local ) {
$row .= Linker::userLink( $userId, $userText );
- $row .= $this->msg( 'word-separator' )->escaped();
$row .= '<span style="white-space: nowrap;">';
$row .= Linker::userToolLinks( $userId, $userText );
$row .= '</span>';