* @return Title
*/
public function getTitle() { return $this->title; }
-
+
/**
* Return the title used to find this file
*/
* i.e. whether the files are all found in the same directory,
* or in hashed paths like /images/3/3c.
*
+ * Most callers don't check the return value, but ForeignAPIFile::getPath
+ * returns false.
*/
public function getPath() {
if ( !isset( $this->path ) ) {
/**
* Alias for getPath()
*
- * @deprecated Use getPath().
+ * @deprecated since 1.18 Use getPath().
*/
public function getFullPath() {
wfDeprecated( __METHOD__ );
}
/**
- * Return true if the file is vectorized
- */
+ * Return true if the file is vectorized
+ */
public function isVectorized() {
$handler = $this->getHandler();
if ( $handler ) {
$handler = $this->getHandler();
if ( !is_array( $metadata ) ) {
//just to make the return type consistant
- $metadata = unserialize( $metadata );
+ $metadata = unserialize( $metadata );
}
if ( $handler ) {
return $handler->convertMetadataVersion( $metadata, $version );
function thumbName( $params ) {
return $this->generateThumbName( $this->getName(), $params );
}
-
+
/**
* Generate a thumbnail file name from a name and specified parameters
*
if ( file_exists( $thumbPath )) {
$thumbTime = filemtime( $thumbPath );
if ( $thumbTime !== FALSE &&
- gmdate( 'YmdHis', $thumbTime ) >= $wgThumbnailEpoch ) {
-
+ gmdate( 'YmdHis', $thumbTime ) >= $wgThumbnailEpoch ) {
+
$thumb = $this->handler->getTransform( $this, $thumbPath, $thumbUrl, $params );
break;
}
$thumb = $this->handler->getTransform( $this, $thumbPath, $thumbUrl, $params );
}
}
-
- // Purge. Useful in the event of Core -> Squid connection failure or squid
- // purge collisions from elsewhere during failure. Don't keep triggering for
+
+ // Purge. Useful in the event of Core -> Squid connection failure or squid
+ // purge collisions from elsewhere during failure. Don't keep triggering for
// "thumbs" which have the main image URL though (bug 13776)
if ( $wgUseSquid && ( !$thumb || $thumb->isError() || $thumb->getUrl() != $this->getURL()) ) {
SquidUpdate::purge( array( $thumbUrl ) );
$this->readOnlyError();
}
- /**
- * Get an array of Title objects which are articles which use this file
- * Also adds their IDs to the link cache
- *
- * This is mostly copied from Title::getLinksTo()
- *
- * @deprecated Use HTMLCacheUpdate, this function uses too much memory
- */
- function getLinksTo( $options = array() ) {
- wfDeprecated( __METHOD__ );
- wfProfileIn( __METHOD__ );
-
- // Note: use local DB not repo DB, we want to know local links
- if ( count( $options ) > 0 ) {
- $db = wfGetDB( DB_MASTER );
- } else {
- $db = wfGetDB( DB_SLAVE );
- }
- $linkCache = LinkCache::singleton();
-
- $encName = $db->addQuotes( $this->getName() );
- $res = $db->select( array( 'page', 'imagelinks'),
- array( 'page_namespace', 'page_title', 'page_id', 'page_len', 'page_is_redirect', 'page_latest' ),
- array( 'page_id=il_from', 'il_to' => $encName ),
- __METHOD__,
- $options );
-
- $retVal = array();
- if ( $db->numRows( $res ) ) {
- foreach ( $res as $row ) {
- $titleObj = Title::newFromRow( $row );
- if ( $titleObj ) {
- $linkCache->addGoodLinkObj( $row->page_id, $titleObj, $row->page_len, $row->page_is_redirect, $row->page_latest );
- $retVal[] = $titleObj;
- }
- }
- }
- wfProfileOut( __METHOD__ );
- return $retVal;
- }
-
function formatMetadata() {
if ( !$this->getHandler() ) {
return false;
function getRepoName() {
return $this->repo ? $this->repo->getName() : 'unknown';
}
+
/*
* Returns the repository
*/
function isDeleted( $field ) {
return false;
}
-
+
/**
* Return the deletion bitfield
* STUB
- */
+ */
function getVisibility() {
return 0;
}
}
/**
- * Returns 'true' if this file is a type which supports multiple pages,
- * e.g. DJVU or PDF. Note that this may be true even if the file in
+ * Returns 'true' if this file is a type which supports multiple pages,
+ * e.g. DJVU or PDF. Note that this may be true even if the file in
* question only has a single page.
*
* @return Bool
if ( $renderUrl ) {
if ( $this->repo->descriptionCacheExpiry > 0 ) {
wfDebug("Attempting to get the description from cache...");
- $key = $this->repo->getLocalCacheKey( 'RemoteFileDescription', 'url', $wgLang->getCode(),
+ $key = $this->repo->getLocalCacheKey( 'RemoteFileDescription', 'url', $wgLang->getCode(),
$this->getName() );
$obj = $wgMemc->get($key);
if ($obj) {
}
$ext = $this->getExtension();
$dotExt = $ext === '' ? '' : ".$ext";
- return $hash . $dotExt;
+ return $hash . $dotExt;
}
/**
function getRedirected() {
return $this->redirected;
}
-
+
function getRedirectedTitle() {
if ( $this->redirected ) {
if ( !$this->redirectTitle ) {