Go to the documentation of this file.
182 # Normalize NS_MEDIA -> NS_FILE
185 # Sanity check the title namespace
190 # Convert strings to Title objects
193 if ( !
$ret && $exception !==
false ) {
194 throw new MWException(
"`$title` is not a valid file title." );
201 $function =
array( $this,
'get' . ucfirst(
$name ) );
202 if ( !is_callable( $function ) ) {
205 $this->$name = call_user_func( $function );
219 $lower = strtolower(
$ext );
226 if ( isset( $squish[$lower] ) ) {
227 return $squish[$lower];
228 } elseif ( preg_match(
'/^[0-9a-z]+$/', $lower ) ) {
245 $n = strrpos( $new,
'.' );
247 $mimeMagic = MimeMagic::singleton();
249 return $mimeMagic->isMatchingExtension( $newExt, $oldMime );
268 if ( strpos(
$mime,
'/' ) !==
false ) {
269 return explode(
'/',
$mime, 2 );
292 if ( !isset( $this->
name ) ) {
294 $this->
name = $this->repo->getNameFromTitle( $this->
title );
306 if ( !isset( $this->extension ) ) {
330 if ( $this->redirected ) {
342 public function getUrl() {
343 if ( !isset( $this->url ) ) {
346 $this->url = $this->repo->getZoneUrl(
'public',
$ext ) .
'/' . $this->
getUrlRel();
378 wfDebug( __METHOD__ .
': supposed to render ' . $this->
getName() .
381 return $this->getURL(); #hm...
return NULL?
384 return $this->getURL();
402 if ( !isset( $this->path ) ) {
404 $this->path = $this->repo->getZonePath(
'public' ) .
'/' . $this->
getRel();
419 if ( !isset( $this->fsFile ) ) {
420 $this->fsFile = $this->repo->getLocalReference( $this->
getPath() );
421 if ( !$this->fsFile ) {
422 $this->fsFile =
false;
426 return ( $this->fsFile )
427 ? $this->fsFile->getPath()
441 public function getWidth( $page = 1 ) {
603 if ( !is_array( $metadata ) ) {
605 $metadata = unserialize( $metadata );
642 return 'unknown/unknown';
695 return $this->
getHandler() && $this->handler->mustRender( $this );
743 global $wgTrustedMediaFormats;
754 #wfDebug( "LocalFile::isSafeFile: type= $type, mime= $mime\n" );
757 return false; #unknown
type, not trusted
759 if ( in_array(
$type, $wgTrustedMediaFormats ) ) {
763 if (
$mime ===
"unknown/unknown" ) {
764 return false; #unknown
type, not trusted
766 if ( in_array(
$mime, $wgTrustedMediaFormats ) ) {
787 #this could be implemented to check a flag in the database,
788 #look for signatures, etc
799 public function exists() {
800 return $this->
getPath() && $this->repo->fileExists( $this->path );
817 if ( !isset( $this->transformScript ) ) {
818 $this->transformScript =
false;
820 $script = $this->repo->getThumbScriptUrl();
839 $page = isset( $hp[
'page'] ) ? $hp[
'page'] :
false;
844 $hp[
'width'] = $width;
860 ? $this->repo->nameForThumb( $this->
getName() )
878 list( $thumbExt, ) = $this->handler->getThumbType(
880 $thumbName = $this->handler->makeParamString(
$params ) .
'-' .
$name;
882 $thumbName .=
".$thumbExt";
905 public function createThumb( $width, $height = -1 ) {
907 if ( $height != -1 ) {
911 if ( !$thumb || $thumb->isError() ) {
915 return $thumb->getUrl();
928 global $wgIgnoreImageErrors;
931 if ( $handler && $wgIgnoreImageErrors && !(
$flags & self::RENDER_NOW ) ) {
948 global $wgUseSquid, $wgIgnoreImageErrors, $wgThumbnailEpoch;
959 if ( $descriptionUrl ) {
965 if ( $script && !(
$flags & self::RENDER_NOW ) ) {
976 $thumbName = $this->
thumbName( $normalisedParams );
983 wfDebug( __METHOD__ .
" transformation deferred.\n" );
993 wfDebug( __METHOD__ .
": Doing stat for $thumbPath\n" );
994 if ( !(
$flags & self::RENDER_FORCE ) && $this->repo->fileExists( $thumbPath ) ) {
995 $timestamp = $this->repo->getFileTimestamp( $thumbPath );
1001 $thumb->setStoragePath( $thumbPath );
1004 } elseif (
$flags & self::RENDER_FORCE ) {
1005 wfDebug( __METHOD__ .
" forcing rendering per flag File::RENDER_FORCE\n" );
1011 if ( $this->repo->getReadOnlyReason() !==
false ) {
1023 $tmpThumbPath = $tmpFile->getPath();
1029 $tmpFile->bind( $thumb );
1033 } elseif ( $thumb->isError() ) {
1034 $this->lastError = $thumb->toText();
1036 if ( $wgIgnoreImageErrors && !(
$flags & self::RENDER_NOW ) ) {
1039 } elseif ( $this->repo && $thumb->hasFile() && !$thumb->fileIsSource() ) {
1042 $status = $this->repo->quickImport( $tmpThumbPath, $thumbPath, $disposition );
1043 if ( $status->isOK() ) {
1044 $thumb->setStoragePath( $thumbPath );
1049 wfRunHooks(
'FileTransformed',
array( $this, $thumb, $tmpThumbPath, $thumbPath ) );
1055 if ( $wgUseSquid ) {
1056 if ( !$thumb || $thumb->isError() || $thumb->getUrl() != $this->getURL() ) {
1064 return is_object( $thumb ) ? $thumb :
false;
1075 if ( $thumbExt !=
'' && $thumbExt !== $this->
getExtension() ) {
1076 $fileName .=
".$thumbExt";
1097 if ( !isset( $this->handler ) ) {
1110 global $wgStylePath, $wgStyleDirectory;
1113 foreach ( $try
as $icon ) {
1114 $path =
'/common/images/icons/' . $icon;
1115 $filepath = $wgStyleDirectory .
$path;
1116 if ( file_exists( $filepath ) ) {
1180 $update->doUpdate();
1195 function getHistory(
$limit =
null, $start =
null, $end =
null, $inc =
true ) {
1229 if ( !isset( $this->hashPath ) ) {
1231 $this->hashPath = $this->repo->getHashPath( $this->
getName() );
1256 if ( $suffix ===
false ) {
1274 if ( $suffix !==
false ) {
1275 $path .=
'/' . $suffix;
1301 if ( $suffix ===
false ) {
1319 return $this->repo->getZonePath(
'public' ) .
'/' . $this->
getArchiveRel( $suffix );
1332 return $this->repo->getZonePath(
'thumb' ) .
'/' .
1345 return $this->repo->getZonePath(
'thumb' ) .
'/' . $this->
getThumbRel( $suffix );
1357 return $this->repo->getZonePath(
'transcoded' ) .
'/' . $this->
getThumbRel( $suffix );
1369 $path = $this->repo->getZoneUrl(
'public',
$ext ) .
'/archive/' . $this->
getHashPath();
1370 if ( $suffix ===
false ) {
1373 $path .= rawurlencode( $suffix );
1389 $path = $this->repo->getZoneUrl(
'thumb',
$ext ) .
'/archive/' .
1390 $this->
getHashPath() . rawurlencode( $archiveName ) .
"/";
1391 if ( $suffix ===
false ) {
1394 $path .= rawurlencode( $suffix );
1407 function getZoneUrl( $zone, $suffix =
false ) {
1410 $path = $this->repo->getZoneUrl( $zone,
$ext ) .
'/' . $this->
getUrlRel();
1411 if ( $suffix !==
false ) {
1412 $path .=
'/' . rawurlencode( $suffix );
1425 return $this->
getZoneUrl(
'thumb', $suffix );
1435 return $this->
getZoneUrl(
'transcoded', $suffix );
1446 $path = $this->repo->getVirtualUrl() .
'/public/' . $this->
getUrlRel();
1447 if ( $suffix !==
false ) {
1448 $path .=
'/' . rawurlencode( $suffix );
1462 $path = $this->repo->getVirtualUrl() .
'/public/archive/' . $this->
getHashPath();
1463 if ( $suffix ===
false ) {
1466 $path .= rawurlencode( $suffix );
1480 $path = $this->repo->getVirtualUrl() .
'/thumb/' . $this->
getUrlRel();
1481 if ( $suffix !==
false ) {
1494 return (
bool)$this->repo->getHashLevels();
1501 throw new MWException( get_class( $this ) .
': write operations are not supported' );
1567 return $this->repo && $this->repo->isLocal();
1576 return $this->repo ? $this->repo->getName() :
'unknown';
1659 function delete( $reason, $suppress =
false ) {
1677 function restore( $versions =
array(), $unsuppress =
false ) {
1689 return $this->
getHandler() && $this->handler->isMultiPage( $this );
1700 if ( $this->
getHandler() && $this->handler->isMultiPage( $this ) ) {
1719 static function scaleHeight( $srcWidth, $srcHeight, $dstWidth ) {
1721 if ( $srcWidth == 0 ) {
1724 return round( $srcHeight * $dstWidth / $srcWidth );
1740 return $this->handler->getImageSize( $this, $fileName );
1750 if ( $this->repo ) {
1751 return $this->repo->getDescriptionUrl( $this->
getName() );
1765 if ( !$this->repo || !$this->repo->fetchDescription ) {
1771 $renderUrl = $this->repo->getDescriptionRenderUrl( $this->
getName(), $lang->getCode() );
1773 if ( $this->repo->descriptionCacheExpiry > 0 ) {
1774 wfDebug(
"Attempting to get the description from cache..." );
1775 $key = $this->repo->getLocalCacheKey(
1776 'RemoteFileDescription',
1789 wfDebug(
"Fetching shared description from $renderUrl\n" );
1791 if (
$res && $this->repo->descriptionCacheExpiry > 0 ) {
1792 $wgMemc->set( $key,
$res, $this->repo->descriptionCacheExpiry );
1825 return $this->repo->getFileTimestamp( $this->
getPath() );
1836 return $this->repo->getFileSha1( $this->
getPath() );
1850 $dotExt =
$ext ===
'' ?
'' :
".$ext";
1852 return $hash . $dotExt;
1878 wfDebug( __METHOD__ .
": Getting file info for $path\n" );
1964 if ( $this->redirected ) {
1965 if ( !$this->redirectTitle ) {
1980 $this->redirected =
$from;
2003 if ( !( $this->repo instanceof $this->repoClass ) ) {
2004 throw new MWException(
"A {$this->repoClass} object is not set for this File.\n" );
2014 throw new MWException(
"A Title object is not set for this File.\n" );
getExtension()
Get the file extension, e.g.
wasDeleted()
Was this file ever deleted from the wiki?
getPath()
Return the storage path to the file.
static & makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Media transform output for images.
static checkExtensionCompatibility(File $old, $new)
Checks if file extensions are compatible.
FileRepo LocalRepo ForeignAPIRepo bool $repo
Some member variables can be lazy-initialised using __get().
canAnimateThumbIfAppropriate()
Will the thumbnail be animated if one would expect it to be.
getArchiveThumbPath( $archiveName, $suffix=false)
Get the path of an archived file's thumbs, or a particular thumb if $suffix is specified.
getHeight( $page=1)
Return the height of the image.
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
getBitDepth()
Return the bit depth of the file Overridden by LocalFile STUB.
usually copyright or history_copyright This message must be in HTML not wikitext $subpages will be ignored and the rest of subPageSubtitle() will run. 'SkinTemplateBuildNavUrlsNav_urlsAfterPermalink' whether MediaWiki currently thinks this is a CSS JS page Hooks may change this value to override the return value of Title::isCssOrJsPage(). 'TitleIsAlwaysKnown' whether MediaWiki currently thinks this page is known isMovable() always returns false. $title whether MediaWiki currently thinks this page is movable Hooks may change this value to override the return value of Title::isMovable(). 'TitleIsWikitextPage' whether MediaWiki currently thinks this is a wikitext page Hooks may change this value to override the return value of Title::isWikitextPage() 'TitleMove' use UploadVerification and UploadVerifyFile instead where the first element is the message key and the remaining elements are used as parameters to the message based on mime etc Preferred in most cases over UploadVerification object with all info about the upload string $mime
getUrlRel()
Get urlencoded path of the file relative to the public zone root.
migrateThumbFile( $thumbName)
Hook into transform() to allow migration of thumbnail files STUB Overridden by LocalFile.
isMultipage()
Returns 'true' if this file is a type which supports multiple pages, e.g.
getFullUrl()
Return a fully-qualified URL to the file.
purgeCache( $options=array())
Purge shared caches such as thumbnails and DB data caching STUB Overridden by LocalFile.
getZoneUrl( $zone, $suffix=false)
Get the URL of the zone directory, or a particular file if $suffix is specified.
getMetadata()
Get handler-specific metadata Overridden by LocalFile, UnregisteredLocalFile STUB.
getIsSafeFileUncached()
Uncached accessor.
string $transformScript
URL of transformscript (for example thumb.php) *.
getRel()
Get the path of the file relative to the public zone root.
globals will be eliminated from MediaWiki replaced by an application object which would be passed to constructors Whether that would be an convenient solution remains to be but certainly PHP makes such object oriented programming models easier than they were in previous versions For the time being MediaWiki programmers will have to work in an environment with some global context At the time of globals were initialised on startup by MediaWiki of these were configuration which are documented in DefaultSettings php There is no comprehensive documentation for the remaining however some of the most important ones are listed below They are typically initialised either in index php or in Setup php For a description of the see design txt $wgTitle Title object created from the request URL $wgOut OutputPage object for HTTP response $wgUser User object for the user associated with the current request $wgLang Language object selected by user preferences $wgContLang Language object associated with the wiki being viewed $wgParser Parser object Parser extensions register their hooks here $wgRequest WebRequest to get request data $wgMemc
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
getOriginalTitle()
Return the title used to find this file.
getProps( $ext=true)
Get an associative array containing information about a file with the given storage path.
getLastError()
Get last thumbnailing error.
wfProfileIn( $functionname)
Begin profiling of a function.
getTimestamp()
Get the 14-character timestamp of the file upload.
getSha1()
Get the SHA-1 base 36 hash of the file.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses & $ret
convertMetadataVersion( $metadata, $version)
get versioned metadata
getUser( $type='text')
Returns ID or name of user who uploaded the file STUB.
string $pageCount
number of pages of a multipage document, or false for documents which aren't multipage documents
const RENDER_FORCE
Force rendering even if thumbnail already exist and using RENDER_NOW I.e.
getUrl()
Return the URL of the file.
static compare(File $a, File $b)
Callback for usort() to do file sorts by name.
getTranscodedUrl( $suffix=false)
Get the URL of the transcoded directory, or a particular file if $suffix is specified.
getWidth( $page=1)
Return the width of the image.
recordUpload( $oldver, $desc, $license='', $copyStatus='', $source='', $watch=false, $timestamp=false, User $user=null)
Record a file upload in the upload log and the image table STUB Overridden by LocalFile.
getMediaType()
Return the type of the media in the file.
static splitMime( $mime)
Split an internet media type into its two components; if not a two-part name, set the minor type to '...
isVisible()
Returns true if file exists in the repository and can be included in a page.
it s the revision text itself In either if gzip is the revision text is gzipped $flags
string $repoClass
Required Repository class type *.
getArchiveRel( $suffix=false)
Get the path of an archived file relative to the public zone root.
isDeleted( $field)
Is this file a "deleted" file in a private archive? STUB.
getVisibility()
Return the deletion bitfield STUB.
getDescriptionText( $lang=false)
Get the HTML text of the description page, if available.
static normalizeTitle( $title, $exception=false)
Given a string or Title object return either a valid Title object with namespace NS_FILE or null.
exists()
Returns true if file exists in the repository.
getThumbVirtualUrl( $suffix=false)
Get the virtual URL for a thumbnail file or directory.
upgradeRow()
Upgrade the database row if there is one Called by ImagePage STUB.
Base class for file repositories.
wfAppendQuery( $url, $query)
Append a query string to an existing URL, which may or may not already have query string parameters a...
string $path
The storage path corresponding to one of the zones *.
to move a page</td >< td > &*You are moving the page across *A non empty talk page already exists under the new or *You uncheck the box below In those you will have to move or merge the page manually if desired</td >< td > be sure to &You are responsible for making sure that links continue to point where they are supposed to go Note that the page will &a page at the new title
isCacheable()
Check if this file object is small and can be cached.
static normalizeExtension( $ext)
Normalize a file extension to the common form, and ensure it's clean.
bool $canRender
Wether the output of transform() for this file is likely to be valid.
Implements some public methods and some protected utility functions which are required by multiple ch...
getMimeType()
Returns the mime type of the file.
getDefaultRenderLanguage()
In files that support multiple language, what is the default language to use if none specified.
string $url
The URL corresponding to one of the four basic zones *.
getLocalRefPath()
Get an FS copy or original of this file and return the path.
transformErrorOutput( $thumbPath, $thumbUrl, $params, $flags)
Return either a MediaTransformError or placeholder thumbnail (if $wgIgnoreImageErrors)
getIsSafeFile()
Accessor for __get()
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
getThumbPath( $suffix=false)
Get the path of the thumbnail directory, or a particular file if $suffix is specified.
pageCount()
Returns the number of pages of a multipage document, or false for documents which aren't multipage do...
nextHistoryLine()
Return the history of this file, line by line.
getArchiveVirtualUrl( $suffix=false)
Get the public zone virtual URL for an archived version source file.
static purge( $urlArr)
Purges a list of Squids defined in $wgSquidServers.
wfProfileOut( $functionname='missing')
Stop profiling of a function.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing after in associative array form externallinks including delete and has completed for all link tables default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "<
wfRunHooks( $event, array $args=array(), $deprecatedVersion=null)
Call hook functions defined in $wgHooks.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
getArchiveThumbRel( $archiveName, $suffix=false)
Get the path, relative to the thumbnail zone root, for an archived file's thumbs directory or a speci...
when a variable name is used in a it is silently declared as a new masking the global
getSha1Base36( $recache=false)
Get a SHA-1 hash of a file in the local filesystem, in base-36 lower case encoding,...
getStorageKey()
Get the deletion archive key, "<sha1>.<ext>".
__construct( $title, $repo)
Call this constructor from child classes.
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
processing should stop and the error should be shown to the user * false
getCommonMetaArray()
Like getMetadata but returns a handler independent array of common values.
getThumbRel( $suffix=false)
Get the path, relative to the thumbnail zone root, of the thumbnail directory or a particular file if...
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
static get( $url, $timeout='default', $options=array())
Simple wrapper for Http::request( 'GET' )
getUnscaledThumb( $handlerParams=array())
Get a ThumbnailImage which is the same size as the source.
canRender()
Checks if the output of transform() for this file is likely to be valid.
FSFile bool $fsFile
False if undefined *.
wfDebug( $text, $dest='all')
Sends a line to the debug log if enabled or, optionally, to a comment in output.
Class to invalidate the HTML cache of all the pages linking to a given title.
static makeTitleSafe( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
getAvailableLanguages()
Gives a (possibly empty) list of languages to render the file in.
iconThumb()
Get a ThumbnailImage representing a file type icon.
purgeDescription()
Purge the file description page, but don't go after pages using the file.
static factory( $prefix, $extension='')
Make a new temporary file on the file system.
isOld()
Returns true if the image is an old version STUB.
assertTitleDefined()
Assert that $this->title is set to a Title.
getHistory( $limit=null, $start=null, $end=null, $inc=true)
Return a fragment of the history of file.
generateThumbName( $name, $params)
Generate a thumbnail file name from a name and specified parameters.
createThumb( $width, $height=-1)
Create a thumbnail of the image having the specified width/height.
see documentation in includes Linker php for Linker::makeImageLink & $handlerParams
getDescriptionUrl()
Get the URL of the image description page.
getArchiveThumbUrl( $archiveName, $suffix=false)
Get the URL of the archived file's thumbs, or a particular thumb if $suffix is specified.
getName()
Return the name of this file.
getArchiveUrl( $suffix=false)
Get the URL of the archive directory, or a particular file if $suffix is specified.
getThumbDisposition( $thumbName, $dispositionType='inline')
publish( $srcPath, $flags=0, array $options=array())
Move or copy a file to its public location.
Class representing a non-directory file on the file system.
isSafeFile()
Determines if this media file is in a format that is unlikely to contain viruses or malicious content...
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
getRepoName()
Returns the name of the repository.
string $extension
File extension *.
return false to override stock group addition can be modified try getUserPermissionsErrors userCan checks are continued by internal code can override on output return false to not delete it return false to override the default password checks & $hash
string $hashPath
Relative path including trailing slash *.
static scaleHeight( $srcWidth, $srcHeight, $dstWidth)
Calculate the height of a thumbnail using the source and destination width.
const RENDER_NOW
Force rendering in the current process.
transform( $params, $flags=0)
Transform a media file.
getTitle()
Return the associated title object.
Represents a title within MediaWiki.
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as $wgLang
restore( $versions=array(), $unsuppress=false)
Restore all or specified deleted revisions to the given file.
A foreign repository with a remote MediaWiki with an API thingy.
bool $isSafeFile
Wether this media file is in a format that is unlikely to contain viruses or malicious content.
This document describes the state of Postgres support in and is fairly well maintained The main code is very well while extensions are very hit and miss it is probably the most supported database after MySQL Much of the work in making MediaWiki database agnostic came about through the work of creating Postgres as and are nearing end of but without copying over all the usage comments General notes on the but these can almost always be programmed around *Although Postgres has a true BOOLEAN type
move( $target)
Move file to the new title.
assertRepoDefined()
Assert that $this->repo is set to a valid FileRepo instance.
static extensionFromPath( $path)
Get the final extension from a storage or FS path.
getDescription( $audience=self::FOR_PUBLIC, User $user=null)
Get description of file revision STUB.
getLength()
Get the duration of a media file in seconds.
isLocal()
Returns true if the file comes from the local file repository.
purgeSquid()
Purge all applicable Squid URLs.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
static sha1Base36( $path)
Get a SHA-1 hash of a file in the local filesystem, in base-36 lower case encoding,...
getImageSize( $fileName)
Get an image size array like that returned by getImageSize(), or false if it can't be determined.
getCanRender()
Accessor for __get()
if(PHP_SAPI !='cli') $source
mustRender()
Return true if the file is of a type that can't be directly rendered by typical browsers and needs to...
isDeletedQuick()
Is there a version of this page in the deletion archive?
resetHistory()
Reset the history pointer to the first element of the history.
string $name
The name of a file from its title object *.
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at name
getRepo()
Returns the repository.
allowInlineDisplay()
Alias for canRender()
getThumbUrl( $suffix=false)
Get the URL of the thumbnail directory, or a particular file if $suffix is specified.
isVectorized()
Return true if the file is vectorized.
getHandler()
Get a MediaHandler instance for this file.
userCan( $field, User $user=null)
Determine if the current user is allowed to view a particular field of this file, if it's marked as d...
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
thumbName( $params, $flags=0)
Return the file name of a thumbnail with the specified parameters.
string $lastError
Text of last error *.
string $redirected
Main part of the title, with underscores (Title::getDBkey) *.
invalidateCache()
Updates page_touched for this page; called from LinksUpdate.php.
static getPropsFromPath( $path, $ext=true)
Get an associative array containing information about a file in the local filesystem.
getArchivePath( $suffix=false)
Get the path of the archived file.
purgeEverything()
Purge metadata and all affected pages when the file is created, deleted, or majorly updated.
getHashPath()
Get the filename hash component of the directory including trailing slash, e.g.
isTrustedFile()
Returns true if the file is flagged as trusted.
A repository that stores files in the local filesystem and registers them in the wiki's own database.
getSize()
Return the size of the image file, in bytes Overridden by LocalFile, UnregisteredLocalFile STUB.
wfExpandUrl( $url, $defaultProto=PROTO_CURRENT)
Expand a potentially local URL to a fully-qualified URL.
getThumbnails()
Get all thumbnail names previously generated for this file STUB Overridden by LocalFile.
getTranscodedPath( $suffix=false)
Get the path of the transcoded directory, or a particular file if $suffix is specified.
getVirtualUrl( $suffix=false)
Get the public zone virtual URL for a current version source file.
static makeContentDisposition( $type, $filename='')
Build a Content-Disposition header value per RFC 6266.