|
MediaWiki master
|
Implements some public methods and some protected utility functions which are required by multiple child classes. More...
Inherits MediaWiki\Media\MediaHandlerState.
Inherited by MediaWiki\FileRepo\File\ForeignAPIFile, MediaWiki\FileRepo\File\LocalFile, and MediaWiki\FileRepo\File\UnregisteredLocalFile.

Public Member Functions | |||||||
| __construct ( $title, $repo) | |||||||
| Call this constructor from child classes. | |||||||
| __get ( $name) | |||||||
| addToShellboxCommand (BoxedCommand $command, string $boxedName) | |||||||
| Add the file to a Shellbox command as an input file. | |||||||
| allowInlineDisplay () | |||||||
| Alias for canRender(). | |||||||
| appendRequestProvenance (string $url, array $provenance) | |||||||
| Add information about where a URL to an image was generated. | |||||||
| canAnimateThumbIfAppropriate () | |||||||
| Will the thumbnail be animated if one would expect it to be. | |||||||
| canRender () | |||||||
| Checks if the output of transform() for this file is likely to be valid. | |||||||
| convertMetadataVersion ( $metadata, $version) | |||||||
| get versioned metadata | |||||||
| createThumb ( $width, $height=-1) | |||||||
| Create a thumbnail of the image having the specified width/height. | |||||||
| deleteFile ( $reason, UserIdentity $user, $suppress=false) | |||||||
| Delete all versions of the file. | |||||||
| exists () | |||||||
| Returns true if file exists in the repository. | |||||||
| formatMetadata ( $context=false) | |||||||
| generateAndSaveThumb ( $tmpFile, $transformParams, $flags) | |||||||
| Generates a thumbnail according to the given parameters and saves it to storage. | |||||||
| generateThumbName ( $name, $params) | |||||||
| Generate a thumbnail file name from a name and specified parameters. | |||||||
| getArchivePath ( $suffix=false) | |||||||
| Get the path of the archived file. | |||||||
| getArchiveRel ( $suffix=false) | |||||||
| Get the path of an archived file relative to the public zone root. | |||||||
| getArchiveThumbPath ( $archiveName, $suffix=false) | |||||||
| Get the path of an archived file's thumbs, or a particular thumb if $suffix is specified. | |||||||
| getArchiveThumbUrl ( $archiveName, $suffix=false) | |||||||
| Get the URL of the archived file's thumbs, or a particular thumb if $suffix is specified. | |||||||
| getArchiveUrl ( $suffix=false) | |||||||
| Get the URL of the archive directory, or a particular file if $suffix is specified. | |||||||
| getArchiveVirtualUrl ( $suffix=false) | |||||||
| Get the public zone virtual URL for an archived version source file. | |||||||
| getAvailableLanguages () | |||||||
| Gives a (possibly empty) list of IETF languages to render the file in. | |||||||
| getBitDepth () | |||||||
| Return the bit depth of the file Overridden by LocalFile STUB. | |||||||
| getCanonicalUrl () | |||||||
| getCommonMetaArray () | |||||||
| Like getMetadata but returns a handler independent array of common values. | |||||||
| getContentHeaders () | |||||||
| getDefaultRenderLanguage () | |||||||
| In files that support multiple language, what is the default language to use if none specified. | |||||||
| getDescription ( $audience=self::FOR_PUBLIC, ?Authority $performer=null) | |||||||
| Get description of file revision STUB. | |||||||
| getDescriptionShortUrl () | |||||||
| Get short description URL for a files based on the page ID. | |||||||
| getDescriptionText (Language $lang) | |||||||
| Get the HTML text of the description page, if available. | |||||||
| getDescriptionTouched () | |||||||
| Returns the timestamp (in TS::MW format) of the last change of the description page. | |||||||
| getDescriptionUrl () | |||||||
| Get the URL of the image description page. | |||||||
| getDimensionsString (Language $lang) | |||||||
| getDisplayWidthHeight ( $maxWidth, $maxHeight, $page=1) | |||||||
| Get the width and height to display image at. | |||||||
| getExtension () | |||||||
| Get the file extension, e.g. | |||||||
| getFullUrl () | |||||||
| Return a fully-qualified URL to the file. | |||||||
| getHandler (?Language $lang=null) | |||||||
| Get a MediaHandler instance for this file. | |||||||
| getHandlerState (string $key) | |||||||
Get a value, or null if it does not exist.
| |||||||
| getHashPath () | |||||||
| Get the filename hash component of the directory including trailing slash, e.g. | |||||||
| getHeight ( $page=1) | |||||||
| Return the height of the image. | |||||||
| getHistory ( $limit=null, $start=null, $end=null, $inc=true) | |||||||
| Return a fragment of the history of file. | |||||||
| getLastError () | |||||||
| Get last thumbnailing error. | |||||||
| getLength () | |||||||
| Get the duration of a media file in seconds. | |||||||
| getLocalRefPath () | |||||||
| Get an FS copy or original of this file and return the path. | |||||||
| getLongDesc (Language $lang) | |||||||
| Long description. | |||||||
| getMatchedLanguage ( $userPreferredLanguage) | |||||||
| Get the IETF language code from the available languages for this file that matches the language requested by the user. | |||||||
| getMediaType () | |||||||
| Return the type of the media in the file. | |||||||
| getMetadata () | |||||||
| Get handler-specific metadata Overridden by LocalFile, UnregisteredLocalFile STUB. | |||||||
| getMetadataArray () | |||||||
| Get the unserialized handler-specific metadata STUB. | |||||||
| getMetadataItem (string $itemName) | |||||||
| Get a specific element of the unserialized handler-specific metadata. | |||||||
| getMetadataItems (array $itemNames) | |||||||
| Get multiple elements of the unserialized handler-specific metadata. | |||||||
| getMimeType () | |||||||
| Returns the MIME type of the file. | |||||||
| getName () | |||||||
| Return the name of this file. | |||||||
| getOriginalTitle () | |||||||
| Return the title used to find this file. | |||||||
| getPath () | |||||||
| Return the storage path to the file. | |||||||
| getRedirected () | |||||||
| getRel () | |||||||
| Get the path of the file relative to the public zone root. | |||||||
| getRepo () | |||||||
| Returns the repository. | |||||||
| getRepoName () | |||||||
| Returns the name of the repository. | |||||||
| getSha1 () | |||||||
| Get the SHA-1 base 36 hash of the file. | |||||||
| getShortDesc (Language $lang) | |||||||
| Short description. | |||||||
| getSize () | |||||||
| Return the size of the image file, in bytes Overridden by LocalFile, UnregisteredLocalFile STUB. | |||||||
| getStorageKey () | |||||||
| Get the deletion archive key, "<sha1>.<ext>". | |||||||
| getThumbDisposition ( $thumbName, $dispositionType='inline') | |||||||
| getThumbnailBucket ( $desiredWidth, $page=1) | |||||||
| Return the smallest bucket from $wgThumbnailBuckets which is at least $wgThumbnailMinimumBucketDistance larger than $desiredWidth. | |||||||
| getThumbnailSource ( $params) | |||||||
| Returns the most appropriate source image for the thumbnail, given a target thumbnail size. | |||||||
| getThumbPath ( $suffix=false) | |||||||
| Get the path of the thumbnail directory, or a particular file if $suffix is specified. | |||||||
| getThumbRel ( $suffix=false) | |||||||
| Get the path, relative to the thumbnail zone root, of the thumbnail directory or a particular file if $suffix is specified. | |||||||
| getThumbUrl ( $suffix=false) | |||||||
| Get the URL of the thumbnail directory, or a particular file if $suffix is specified. | |||||||
| getThumbVirtualUrl ( $suffix=false) | |||||||
| Get the virtual URL for a thumbnail file or directory. | |||||||
| getTimestamp () | |||||||
| Get the 14-character timestamp of the file upload. | |||||||
| getTitle () | |||||||
| Return the associated title object. | |||||||
| getTranscodedPath ( $suffix=false) | |||||||
| Get the path of the transcoded directory, or a particular file if $suffix is specified. | |||||||
| getTranscodedUrl ( $suffix=false) | |||||||
| Get the URL of the transcoded directory, or a particular file if $suffix is specified. | |||||||
| getUnscaledThumb ( $handlerParams=[]) | |||||||
| Get a ThumbnailImage which is the same size as the source. | |||||||
| getUploader (int $audience=self::FOR_PUBLIC, ?Authority $performer=null) | |||||||
| Get the identity of the file uploader. | |||||||
| getUrl () | |||||||
| Return the URL to the original file. | |||||||
| getUrlRel () | |||||||
| Get urlencoded path of the file relative to the public zone root. | |||||||
| getViewURL () | |||||||
| getVirtualUrl ( $suffix=false) | |||||||
| Get the public zone virtual URL for a current version source file. | |||||||
| getVisibility () | |||||||
| Return the deletion bitfield STUB. | |||||||
| getWidth ( $page=1) | |||||||
| Return the width of the image. | |||||||
| iconThumb () | |||||||
| Get a ThumbnailImage representing a file type icon. | |||||||
| isCacheable () | |||||||
| Check if this file object is small and can be cached. | |||||||
| isDeleted ( $field) | |||||||
| Is this file a "deleted" file in a private archive? | |||||||
| isExpensiveToThumbnail () | |||||||
| True if creating thumbnails from the file is large or otherwise resource-intensive. | |||||||
| isLocal () | |||||||
| Returns true if the file comes from the local file repository. | |||||||
| isMissing () | |||||||
| isMultipage () | |||||||
| Returns 'true' if this file is a type which supports multiple pages, e.g. | |||||||
| isOld () | |||||||
| Returns true if the image is an old version STUB. | |||||||
| isSafeFile () | |||||||
| Determines if this media file is in a format that is unlikely to contain viruses or malicious content. | |||||||
| isTransformedLocally () | |||||||
| Whether the thumbnails created on the same server as this code is running. | |||||||
| isVectorized () | |||||||
| Return true if the file is vectorized. | |||||||
| isVisible () | |||||||
| Returns true if file exists in the repository and can be included in a page. | |||||||
| load ( $flags=0) | |||||||
| Load any lazy-loaded file object fields from source. | |||||||
| modifyClientThumbUrl ( $url, $handlerParams) | |||||||
| Append URL query parameters to a thumbnail URL that are intended to be processed by the browser viewing the final page, or by some proxy, but not by the media handler or the thumbnail server. | |||||||
| move ( $target) | |||||||
| Move file to the new title. | |||||||
| mustRender () | |||||||
| Return true if the file is of a type that can't be directly rendered by typical browsers and needs to be re-rasterized. | |||||||
| nextHistoryLine () | |||||||
| Return the history of this file, line by line. | |||||||
| pageCount () | |||||||
| Returns the number of pages of a multipage document, or false for documents which aren't multipage documents. | |||||||
| parseThumbName (string $name, int $flags=0) | |||||||
| Invert thumbName(), extracting a parameter array from a string of the form "<params>-<source>" or "<params>-thumbnail.<ext>". | |||||||
| publish ( $src, $flags=0, array $options=[]) | |||||||
| Move or copy a file to its public location. | |||||||
| purgeCache ( $options=[]) | |||||||
| Purge shared caches such as thumbnails and DB data caching STUB Overridden by LocalFile. | |||||||
| purgeDescription () | |||||||
| Purge the file description page, but don't go after pages using the file. | |||||||
| purgeEverything () | |||||||
| Purge metadata and all affected pages when the file is created, deleted, or majorly updated. | |||||||
| redirectedFrom (string $from) | |||||||
| resetHistory () | |||||||
| Reset the history pointer to the first element of the history. | |||||||
| restore ( $versions=[], $unsuppress=false) | |||||||
| Restore all or specified deleted revisions to the given file. | |||||||
| setHandlerState (string $key, $value) | |||||||
Set a value.
| |||||||
| thumbName ( $params, $flags=0) | |||||||
| Return the file name of a thumbnail with the specified parameters. | |||||||
| transform ( $params, $flags=0) | |||||||
| Transform a media file. | |||||||
| upgradeRow () | |||||||
| Upgrade the database row if there is one Called by ImagePage STUB. | |||||||
| userCan ( $field, Authority $performer) | |||||||
| Determine if the current user is allowed to view a particular field of this file, if it's marked as deleted. | |||||||
| wasDeleted () | |||||||
| Was this file ever deleted from the wiki? | |||||||
Static Public Member Functions | |
| static | checkExtensionCompatibility (File $old, $new) |
| Checks if file extensions are compatible. | |
| static | compare (File $a, File $b) |
| Callback for usort() to do file sorts by name. | |
| static | normalizeExtension ( $extension) |
| Normalize a file extension to the common form, making it lowercase and checking some synonyms, and ensure it's clean. | |
| static | normalizeTitle ( $title, $exception=false) |
| Given a string or Title object return either a valid Title object with namespace NS_FILE or null. | |
| static | scaleHeight ( $srcWidth, $srcHeight, $dstWidth) |
| Calculate the height of a thumbnail using the source and destination width. | |
| static | splitMime (?string $mime) |
| Split an internet media type into its two components; if not a two-part name, set the minor type to 'unknown'. | |
Public Attributes | |
| FileRepo LocalRepo ForeignAPIRepo false | $repo |
| Some member variables can be lazy-initialised using __get(). | |
| const | DELETE_SOURCE = 1 |
| const | DELETED_COMMENT = 2 |
| const | DELETED_FILE = 1 |
| const | DELETED_RESTRICTED = 8 |
| const | DELETED_USER = 4 |
| const | FOR_PUBLIC = 1 |
| const | FOR_THIS_USER = 2 |
| const | RAW = 3 |
| const | RENDER_FORCE = 2 |
| Force rendering even if thumbnail already exist and using RENDER_NOW I.e. | |
| const | RENDER_NOW = 1 |
| Force rendering in the current process. | |
| const | THUMB_FULL_NAME = 1 |
Protected Member Functions | |
| assertRepoDefined () | |
| Assert that $this->repo is set to a valid FileRepo instance. | |
| assertTitleDefined () | |
| Assert that $this->title is set to a Title. | |
| generateBucketsIfNeeded ( $params, $flags=0) | |
| Generates chained bucketed thumbnails if needed. | |
| getBucketThumbName ( $bucket) | |
| Returns the name of the thumb for a given bucket. | |
| getBucketThumbPath ( $bucket) | |
| Returns the repo path of the thumb for a given bucket. | |
| getCanRender () | |
| Accessor for __get(). | |
| getIsSafeFile () | |
| Accessor for __get(). | |
| getIsSafeFileUncached () | |
| Uncached accessor. | |
| getRedirectedTitle () | |
| getSourcePartOfThumbName ( $flags=0) | |
| Get the source part of the thumb name, which may either be the name of the file, or an abbreviation with the same extension. | |
| getThumbnails () | |
| Get all thumbnail names previously generated for this file STUB Overridden by LocalFile. | |
| getTransformScript () | |
| isHashed () | |
| isTrustedFile () | |
| Returns true if the file is flagged as trusted. | |
| makeTransformTmpFile ( $thumbPath) | |
| Creates a temp FS file with the same extension and the thumbnail. | |
| readOnlyError () | |
| transformErrorOutput ( $thumbPath, $thumbUrl, $params, $flags) | |
| Return either a MediaTransformError or placeholder thumbnail (if $wgIgnoreImageErrors). | |
Protected Attributes | |
| bool null | $canRender |
| Whether the output of transform() for this file is likely to be valid. | |
| string null | $extension |
| File extension. | |
| FSFile false null | $fsFile |
| False if undefined. | |
| MediaHandler null | $handler |
| string null | $hashPath |
| Relative path including trailing slash. | |
| bool null | $isSafeFile |
| Whether this media file is in a format that is unlikely to contain viruses or malicious content. | |
| string | $lastError |
| Text of last error. | |
| string null | $name |
| The name of a file from its title object. | |
| int false null | $pageCount |
| Number of pages of a multipage document, or false for documents which aren't multipage documents. | |
| string null | $path |
| The storage path corresponding to one of the zones. | |
| string | $redirected |
| The name that was used to access the file, before resolving redirects. | |
| Title | $redirectedTitle |
| Title | $redirectTitle |
| string | $repoClass = FileRepo::class |
| Required Repository class type. | |
| Title string false | $title |
| array | $tmpBucketedThumbCache = [] |
| Cache of tmp filepaths pointing to generated bucket thumbnails, keyed by width. | |
| string false null | $transformScript |
| URL of transformscript (for example thumb.php). | |
| string null | $url |
| The URL corresponding to one of the four basic zones. | |
Implements some public methods and some protected utility functions which are required by multiple child classes.
Contains stub functionality for unimplemented public methods.
Stub functions which should be overridden are marked with STUB. Some more concrete functions are also typically overridden by child classes.
Note that only the repo object knows what its file class is called. You should never name a file class explicitly outside of the repo class. Instead use the repo's factory functions to generate file objects, for example:
RepoGroup::singleton()->getLocalRepo()->newFile( $title );
Consider the services container below;
$services = MediaWikiServices::getInstance();
The convenience services $services->getRepoGroup()->getLocalRepo()->newFile() and $services->getRepoGroup()->findFile() should be sufficient in most cases.
| MediaWiki\FileRepo\File\File::__construct | ( | $title, | |
| $repo ) |
Call this constructor from child classes.
Both $title and $repo are optional, though some functions may return false or throw exceptions if they are not set. Most subclasses will want to call assertRepoDefined() here.
| Title | string | false | $title | |
| FileRepo | false | $repo |
Reimplemented in MediaWiki\FileRepo\File\LocalFile.
Definition at line 204 of file File.php.
References $repo, $title, and normalizeTitle().
| MediaWiki\FileRepo\File\File::__get | ( | $name | ) |
| MediaWiki\FileRepo\File\File::addToShellboxCommand | ( | BoxedCommand | $command, |
| string | $boxedName ) |
Add the file to a Shellbox command as an input file.
| BoxedCommand | $command | |
| string | $boxedName |
Definition at line 558 of file File.php.
References getVirtualUrl().
| MediaWiki\FileRepo\File\File::allowInlineDisplay | ( | ) |
Alias for canRender().
Definition at line 962 of file File.php.
References canRender().
Referenced by canAnimateThumbIfAppropriate(), and getIsSafeFileUncached().
|
final |
Add information about where a URL to an image was generated.
| string | $url | URL for this original file or its thumbnail |
| array{generator?:string,format?:string} | $provenance |
Definition at line 421 of file File.php.
References $url, MediaWiki\MediaWikiServices\getInstance(), MW_ENTRY_POINT, MediaWiki\MainConfigNames\ServerName, MediaWiki\MainConfigNames\TrackMediaRequestProvenance, wfAppendQuery(), and wfCgiToArray().
Referenced by getUrl(), and modifyClientThumbUrl().
|
protected |
Assert that $this->repo is set to a valid FileRepo instance.
Definition at line 2596 of file File.php.
Referenced by MediaWiki\FileRepo\File\ForeignAPIFile\__construct(), MediaWiki\FileRepo\File\LocalFile\__construct(), MediaWiki\FileRepo\File\UnregisteredLocalFile\__construct(), getArchivePath(), getArchiveThumbPath(), getArchiveThumbUrl(), getArchiveUrl(), getArchiveVirtualUrl(), getHashPath(), getLocalRefPath(), getName(), getPath(), getSha1(), MediaWiki\FileRepo\File\UnregisteredLocalFile\getSize(), getThumbPath(), getThumbVirtualUrl(), getTimestamp(), getTranscodedPath(), getUrl(), getVirtualUrl(), and isHashed().
|
protected |
Assert that $this->title is set to a Title.
Definition at line 2605 of file File.php.
Referenced by MediaWiki\FileRepo\File\LocalFile\__construct().
| MediaWiki\FileRepo\File\File::canAnimateThumbIfAppropriate | ( | ) |
Will the thumbnail be animated if one would expect it to be.
Currently used to add a warning to the image description page
Definition at line 771 of file File.php.
References $handler, allowInlineDisplay(), MediaWiki\Media\MediaHandler\canAnimateThumbnail(), getHandler(), and MediaWiki\Media\MediaHandler\isAnimatedImage().
| MediaWiki\FileRepo\File\File::canRender | ( | ) |
Checks if the output of transform() for this file is likely to be valid.
In other words, this will return true if a thumbnail can be provided for this image (e.g. if [[File:...|thumb]] produces a result on a wikitext page).
If this is false, various user elements will display a placeholder instead.
Definition at line 929 of file File.php.
References canRender(), exists(), and getHandler().
Referenced by allowInlineDisplay(), canRender(), getCanRender(), getViewURL(), transform(), and MediaWiki\FileRepo\File\ForeignAPIFile\transform().
|
static |
Checks if file extensions are compatible.
| File | $old | Old file |
| string | $new | New name |
Definition at line 295 of file File.php.
References MediaWiki\MediaWikiServices\getInstance(), getMimeType(), and normalizeExtension().
Referenced by MediaWiki\Page\MovePage\isValidFileMove().
| MediaWiki\FileRepo\File\File::convertMetadataVersion | ( | $metadata, | |
| $version ) |
get versioned metadata
| array | $metadata | Array of unserialized metadata |
| int | string | $version | Version number. |
Definition at line 864 of file File.php.
References $handler, and getHandler().
| MediaWiki\FileRepo\File\File::createThumb | ( | $width, | |
| $height = -1 ) |
Create a thumbnail of the image having the specified width/height.
The thumbnail will not be created if the width is larger than the image's width. Let the browser do the scaling in this case. The thumbnail is stored on disk and is only computed if the thumbnail file does not exist OR if it is older than the image. Returns the URL.
Keeps aspect ratio of original image. If both width and height are specified, the generated image will be no bigger than width x height, and will also have correct aspect ratio.
| int | $width | Maximum width of the generated thumbnail |
| int | $height | Maximum height of the image (optional) |
Definition at line 1248 of file File.php.
References transform().
Referenced by getViewURL().
| MediaWiki\FileRepo\File\File::deleteFile | ( | $reason, | |
| UserIdentity | $user, | ||
| $suppress = false ) |
Delete all versions of the file.
Moves the files into an archive directory (or deletes them) and removes the database rows.
Cache purging is done; logging is caller's responsibility.
| string | $reason | |
| UserIdentity | $user | |
| bool | $suppress | Hide content from sysops? |
Reimplemented in MediaWiki\FileRepo\File\ForeignDBFile, and MediaWiki\FileRepo\File\LocalFile.
Definition at line 2242 of file File.php.
References readOnlyError().
| MediaWiki\FileRepo\File\File::exists | ( | ) |
Returns true if file exists in the repository.
Overridden by LocalFile to avoid unnecessary stat calls.
Reimplemented in MediaWiki\FileRepo\File\ForeignAPIFile, MediaWiki\FileRepo\File\LocalFile, MediaWiki\FileRepo\File\OldLocalFile, and MediaWiki\Upload\UploadStashFile.
Definition at line 1069 of file File.php.
References getPath().
Referenced by MediaWiki\Api\ApiDelete\canDeleteFile(), canRender(), MediaWiki\FileRepo\LocalRepo\findFiles(), isVisible(), and MediaWiki\Output\OutputPage\setFileVersion().
| MediaWiki\FileRepo\File\File::formatMetadata | ( | $context = false | ) |
| IContextSource | false | $context |
Definition at line 2130 of file File.php.
References $handler, and getHandler().
| MediaWiki\FileRepo\File\File::generateAndSaveThumb | ( | $tmpFile, | |
| $transformParams, | |||
| $flags ) |
Generates a thumbnail according to the given parameters and saves it to storage.
| TempFSFile | $tmpFile | Temporary file where the rendered thumbnail will be saved |
| array | $transformParams | |
| int | $flags |
Definition at line 1394 of file File.php.
References $handler, generateBucketsIfNeeded(), getHandler(), MediaWiki\MediaWikiServices\getInstance(), getThumbDisposition(), getThumbPath(), getThumbUrl(), MediaWiki\MainConfigNames\IgnoreImageErrors, modifyClientThumbUrl(), thumbName(), transformErrorOutput(), wfDebug(), and wfMessage().
Referenced by generateBucketsIfNeeded(), and transform().
|
protected |
Generates chained bucketed thumbnails if needed.
| array | $params | |
| int | $flags |
Definition at line 1476 of file File.php.
References generateAndSaveThumb(), getBucketThumbPath(), getHandler(), MediaWiki\MediaWikiServices\getInstance(), getThumbnailBucket(), and makeTransformTmpFile().
Referenced by generateAndSaveThumb().
| MediaWiki\FileRepo\File\File::generateThumbName | ( | $name, | |
| $params ) |
Generate a thumbnail file name from a name and specified parameters.
| string | $name | |
| array | $params | Parameters which will be passed to MediaHandler::makeParamString |
Definition at line 1164 of file File.php.
References $extension, $name, getExtension(), getHandler(), getMimeType(), and getSha1().
Referenced by thumbName().
| MediaWiki\FileRepo\File\File::getArchivePath | ( | $suffix = false | ) |
Get the path of the archived file.
| string | false | $suffix | If not false, the name of an archived file. |
Definition at line 1885 of file File.php.
References assertRepoDefined(), and getArchiveRel().
| MediaWiki\FileRepo\File\File::getArchiveRel | ( | $suffix = false | ) |
Get the path of an archived file relative to the public zone root.
| string | false | $suffix | If not false, the name of an archived thumbnail file |
Definition at line 1823 of file File.php.
References $path, and getHashPath().
Referenced by getArchivePath(), MediaWiki\FileRepo\File\OldLocalFile\getRel(), MediaWiki\FileRepo\File\OldLocalFile\getUrlRel(), MediaWiki\FileRepo\File\LocalFile\publishTo(), and MediaWiki\FileRepo\File\OldLocalFile\uploadOld().
| MediaWiki\FileRepo\File\File::getArchiveThumbPath | ( | $archiveName, | |
| $suffix = false ) |
Get the path of an archived file's thumbs, or a particular thumb if $suffix is specified.
| string | $archiveName | The timestamped name of an archived image |
| string | false | $suffix | If not false, the name of a thumbnail file |
Definition at line 1898 of file File.php.
References assertRepoDefined().
Referenced by MediaWiki\FileRepo\File\LocalFile\getThumbnails().
| MediaWiki\FileRepo\File\File::getArchiveThumbUrl | ( | $archiveName, | |
| $suffix = false ) |
Get the URL of the archived file's thumbs, or a particular thumb if $suffix is specified.
| string | $archiveName | The timestamped name of an archived image |
| string | false | $suffix | If not false, the name of a thumbnail file |
Definition at line 1958 of file File.php.
References $path, assertRepoDefined(), getExtension(), and getHashPath().
Referenced by MediaWiki\FileRepo\File\LocalFile\purgeOldThumbnails().
| MediaWiki\FileRepo\File\File::getArchiveUrl | ( | $suffix = false | ) |
Get the URL of the archive directory, or a particular file if $suffix is specified.
| string | false | $suffix | If not false, the name of an archived file |
Definition at line 1937 of file File.php.
References $path, assertRepoDefined(), getExtension(), and getHashPath().
Referenced by MediaWiki\FileRepo\File\LocalFile\deleteFile(), and MediaWiki\FileRepo\File\LocalFile\deleteOldFile().
| MediaWiki\FileRepo\File\File::getArchiveVirtualUrl | ( | $suffix = false | ) |
Get the public zone virtual URL for an archived version source file.
| string | false | $suffix | If not false, the name of a thumbnail file |
Definition at line 2058 of file File.php.
References $path, assertRepoDefined(), and getHashPath().
| MediaWiki\FileRepo\File\File::getAvailableLanguages | ( | ) |
Gives a (possibly empty) list of IETF languages to render the file in.
If the file doesn't have translations, or if the file format does not support that sort of thing, returns an empty array.
Definition at line 717 of file File.php.
References $handler, MediaWiki\Media\MediaHandler\getAvailableLanguages(), and getHandler().
| MediaWiki\FileRepo\File\File::getBitDepth | ( | ) |
Return the bit depth of the file Overridden by LocalFile STUB.
Reimplemented in MediaWiki\FileRepo\File\LocalFile, and MediaWiki\FileRepo\File\UnregisteredLocalFile.
|
protected |
Returns the name of the thumb for a given bucket.
| int | $bucket |
Definition at line 1608 of file File.php.
References thumbName().
Referenced by getBucketThumbPath().
|
protected |
Returns the repo path of the thumb for a given bucket.
| int | $bucket |
Definition at line 1598 of file File.php.
References getBucketThumbName(), and getThumbPath().
Referenced by generateBucketsIfNeeded(), and getThumbnailSource().
| MediaWiki\FileRepo\File\File::getCanonicalUrl | ( | ) |
Definition at line 479 of file File.php.
References MediaWiki\MediaWikiServices\getInstance(), getUrl(), and PROTO_CANONICAL.
|
protected |
| MediaWiki\FileRepo\File\File::getCommonMetaArray | ( | ) |
Like getMetadata but returns a handler independent array of common values.
Definition at line 852 of file File.php.
References $handler, and getHandler().
| MediaWiki\FileRepo\File\File::getContentHeaders | ( | ) |
Definition at line 2486 of file File.php.
References $handler, getHandler(), and getMetadataArray().
| MediaWiki\FileRepo\File\File::getDefaultRenderLanguage | ( | ) |
In files that support multiple language, what is the default language to use if none specified.
Definition at line 752 of file File.php.
References $handler, MediaWiki\Media\MediaHandler\getDefaultRenderLanguage(), and getHandler().
| MediaWiki\FileRepo\File\File::getDescription | ( | $audience = self::FOR_PUBLIC, | |
| ?Authority | $performer = null ) |
Get description of file revision STUB.
| int | $audience | One of: File::FOR_PUBLIC to be displayed to all users File::FOR_THIS_USER to be displayed to the given user File::RAW get the description regardless of permissions |
| Authority | null | $performer | to check for, only if FOR_THIS_USER is passed to the $audience parameter |
Reimplemented in MediaWiki\FileRepo\File\ForeignAPIFile, and MediaWiki\FileRepo\File\LocalFile.
| MediaWiki\FileRepo\File\File::getDescriptionShortUrl | ( | ) |
Get short description URL for a files based on the page ID.
Reimplemented in MediaWiki\FileRepo\File\ForeignAPIFile, MediaWiki\FileRepo\File\ForeignDBFile, and MediaWiki\FileRepo\File\LocalFile.
| MediaWiki\FileRepo\File\File::getDescriptionText | ( | Language | $lang | ) |
Get the HTML text of the description page, if available.
| Language | $lang | Language to fetch description in. |
Reimplemented in MediaWiki\FileRepo\File\ForeignDBFile, and MediaWiki\FileRepo\File\LocalFile.
Definition at line 2347 of file File.php.
References MediaWiki\Language\Language\getCode(), MediaWiki\MediaWikiServices\getInstance(), getName(), and wfDebug().
| MediaWiki\FileRepo\File\File::getDescriptionTouched | ( | ) |
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.
Reimplemented in MediaWiki\FileRepo\File\LocalFile.
| MediaWiki\FileRepo\File\File::getDescriptionUrl | ( | ) |
Get the URL of the image description page.
May return false if it is unknown or not applicable.
Reimplemented in MediaWiki\FileRepo\File\ForeignAPIFile, MediaWiki\FileRepo\File\ForeignDBFile, MediaWiki\FileRepo\File\LocalFile, and MediaWiki\Upload\UploadStashFile.
Definition at line 2320 of file File.php.
References getName().
Referenced by MediaWiki\FileRepo\File\ForeignDBFile\getDescriptionUrl(), MediaWiki\Page\ImagePage\imageDupes(), and transform().
| MediaWiki\FileRepo\File\File::getDimensionsString | ( | Language | $lang | ) |
| Language | $lang | Language to return the description in (since 1.46) |
Definition at line 2539 of file File.php.
References $handler, and getHandler().
| MediaWiki\FileRepo\File\File::getDisplayWidthHeight | ( | $maxWidth, | |
| $maxHeight, | |||
| $page = 1 ) |
Get the width and height to display image at.
| int | $maxWidth | Max width to display at |
| int | $maxHeight | Max height to display at |
| int | $page |
Definition at line 647 of file File.php.
References getHeight(), and getWidth().
| MediaWiki\FileRepo\File\File::getExtension | ( | ) |
Get the file extension, e.g.
"svg"
Definition at line 363 of file File.php.
References $extension, getName(), and normalizeExtension().
Referenced by generateThumbName(), getArchiveThumbUrl(), getArchiveUrl(), MediaWiki\FileRepo\File\ForeignAPIFile\getMimeType(), getStorageKey(), getThumbDisposition(), getUrl(), and iconThumb().
| MediaWiki\FileRepo\File\File::getFullUrl | ( | ) |
Return a fully-qualified URL to the file.
Upload URL paths may or may not be fully qualified, so we check. Local paths are assumed to belong on $wgServer.
Definition at line 470 of file File.php.
References MediaWiki\MediaWikiServices\getInstance(), getUrl(), and PROTO_RELATIVE.
| MediaWiki\FileRepo\File\File::getHandler | ( | ?Language | $lang = null | ) |
Get a MediaHandler instance for this file.
| Language | null | $lang | The language this media handler will use to localize descriptions. If null, descriptions will not work. Note that $this->handler->getLanguage() will return the language specified in the last call of this function (or MediaHandler::setLanguage directly). |
Definition at line 1648 of file File.php.
References getMimeType().
Referenced by canAnimateThumbIfAppropriate(), canRender(), convertMetadataVersion(), formatMetadata(), generateAndSaveThumb(), generateBucketsIfNeeded(), generateThumbName(), getAvailableLanguages(), getCommonMetaArray(), getContentHeaders(), getDefaultRenderLanguage(), getDimensionsString(), MediaWiki\FileRepo\File\LocalFile\getHeight(), getLength(), getLongDesc(), getMatchedLanguage(), getShortDesc(), getThumbnailSource(), MediaWiki\FileRepo\File\LocalFile\getWidth(), MediaWiki\JobQueue\Jobs\ThumbnailRenderJob\hitThumbUrl(), isExpensiveToThumbnail(), isMultipage(), isVectorized(), MediaWiki\FileRepo\File\LocalFile\maybeUpgradeRow(), mustRender(), pageCount(), parseThumbName(), MediaWiki\FileRepo\File\ForeignAPIFile\purgeThumbnails(), MediaWiki\FileRepo\File\LocalFile\purgeThumbnails(), transform(), transformErrorOutput(), and wfThumbIsStandard().
| MediaWiki\FileRepo\File\File::getHandlerState | ( | string | $key | ) |
Get a value, or null if it does not exist.
| string | $key |
Implements MediaWiki\Media\MediaHandlerState.
| MediaWiki\FileRepo\File\File::getHashPath | ( | ) |
Get the filename hash component of the directory including trailing slash, e.g.
f/fa/ If the repository is not hashed, returns an empty string.
Definition at line 1795 of file File.php.
References assertRepoDefined(), and getName().
Referenced by getArchiveRel(), getArchiveThumbUrl(), getArchiveUrl(), getArchiveVirtualUrl(), getRel(), MediaWiki\FileRepo\File\ForeignAPIFile\getThumbPath(), and getUrlRel().
| MediaWiki\FileRepo\File\File::getHeight | ( | $page = 1 | ) |
Return the height of the image.
Returns false if the height is unknown or undefined
STUB Overridden by LocalFile, UnregisteredLocalFile
| int | $page |
Reimplemented in MediaWiki\FileRepo\File\ForeignAPIFile, MediaWiki\FileRepo\File\LocalFile, and MediaWiki\FileRepo\File\UnregisteredLocalFile.
Definition at line 588 of file File.php.
Referenced by getDisplayWidthHeight(), MediaWiki\Media\ImageHandler\getImageArea(), MediaWiki\Media\SvgHandler\getLongDesc(), and getThumbnailSource().
| MediaWiki\FileRepo\File\File::getHistory | ( | $limit = null, | |
| $start = null, | |||
| $end = null, | |||
| $inc = true ) |
Return a fragment of the history of file.
STUB
| int | null | $limit | Limit of rows to return |
| string | int | null | $start | Only revisions older than $start will be returned |
| string | int | null | $end | Only revisions newer than $end will be returned |
| bool | $inc | Include the endpoints of the time range |
Reimplemented in MediaWiki\FileRepo\File\LocalFile.
|
protected |
|
protected |
Uncached accessor.
Definition at line 998 of file File.php.
References allowInlineDisplay(), MediaWiki\MediaWikiServices\getInstance(), getMediaType(), getMimeType(), isTrustedFile(), MEDIATYPE_UNKNOWN, and MediaWiki\MainConfigNames\TrustedMediaFormats.
Referenced by isSafeFile().
| MediaWiki\FileRepo\File\File::getLastError | ( | ) |
| MediaWiki\FileRepo\File\File::getLength | ( | ) |
Get the duration of a media file in seconds.
Definition at line 683 of file File.php.
References $handler, getHandler(), and MediaWiki\Media\MediaHandler\getLength().
| MediaWiki\FileRepo\File\File::getLocalRefPath | ( | ) |
Get an FS copy or original of this file and return the path.
Returns false on failure. Callers must not alter the file. Temporary files are cleared automatically.
Definition at line 532 of file File.php.
References assertRepoDefined(), MediaWiki\MediaWikiServices\getInstance(), and getPath().
Referenced by MediaWiki\FileRepo\File\UnregisteredLocalFile\getMimeType(), and getThumbnailSource().
| MediaWiki\FileRepo\File\File::getLongDesc | ( | Language | $lang | ) |
Long description.
Shown under image on image description page surrounded by ().
Until MediaWiki 1.45, the return value was poorly documented, and some handlers returned HTML while others returned plain text. When calling this method, you should treat it as returning unsafe HTML, and call Sanitizer::removeSomeTags() on the result.
| Language | $lang | User language to return the description in (since 1.46) |
Definition at line 2506 of file File.php.
References $handler, and getHandler().
| MediaWiki\FileRepo\File\File::getMatchedLanguage | ( | $userPreferredLanguage | ) |
Get the IETF language code from the available languages for this file that matches the language requested by the user.
| string | $userPreferredLanguage |
Definition at line 733 of file File.php.
References $handler, MediaWiki\Media\MediaHandler\getAvailableLanguages(), getHandler(), and MediaWiki\Media\MediaHandler\getMatchedLanguage().
| MediaWiki\FileRepo\File\File::getMediaType | ( | ) |
Return the type of the media in the file.
Use the value returned by this function with the MEDIATYPE_xxx constants. Overridden by LocalFile, STUB
Reimplemented in MediaWiki\FileRepo\File\ForeignAPIFile, and MediaWiki\FileRepo\File\LocalFile.
Definition at line 915 of file File.php.
References MEDIATYPE_UNKNOWN.
Referenced by getIsSafeFileUncached().
| MediaWiki\FileRepo\File\File::getMetadata | ( | ) |
Get handler-specific metadata Overridden by LocalFile, UnregisteredLocalFile STUB.
Reimplemented in MediaWiki\FileRepo\File\ForeignAPIFile, MediaWiki\FileRepo\File\LocalFile, and MediaWiki\FileRepo\File\UnregisteredLocalFile.
Definition at line 796 of file File.php.
References wfDeprecated().
| MediaWiki\FileRepo\File\File::getMetadataArray | ( | ) |
Get the unserialized handler-specific metadata STUB.
Reimplemented in MediaWiki\FileRepo\File\ForeignAPIFile, MediaWiki\FileRepo\File\LocalFile, and MediaWiki\FileRepo\File\UnregisteredLocalFile.
Definition at line 817 of file File.php.
References return.
Referenced by MediaWiki\Media\SvgHandler\formatMetadata(), MediaWiki\Media\SvgHandler\getAvailableLanguages(), MediaWiki\Media\ExifBitmapHandler\getCommonMetaArray(), MediaWiki\Media\GIFHandler\getCommonMetaArray(), MediaWiki\Media\PNGHandler\getCommonMetaArray(), MediaWiki\Media\SvgHandler\getCommonMetaArray(), MediaWiki\Media\WebPHandler\getCommonMetaArray(), getContentHeaders(), MediaWiki\Media\SvgHandler\getLongDesc(), getMetadataItems(), and MediaWiki\Media\SvgHandler\isAnimatedImage().
| MediaWiki\FileRepo\File\File::getMetadataItem | ( | string | $itemName | ) |
Get a specific element of the unserialized handler-specific metadata.
| string | $itemName |
Definition at line 828 of file File.php.
References getMetadataItems().
| MediaWiki\FileRepo\File\File::getMetadataItems | ( | array | $itemNames | ) |
Get multiple elements of the unserialized handler-specific metadata.
| string[] | $itemNames |
Reimplemented in MediaWiki\FileRepo\File\LocalFile.
Definition at line 840 of file File.php.
References getMetadataArray(), and return.
Referenced by getMetadataItem().
| MediaWiki\FileRepo\File\File::getMimeType | ( | ) |
Returns the MIME type of the file.
Overridden by LocalFile, UnregisteredLocalFile STUB
Reimplemented in MediaWiki\FileRepo\File\ForeignAPIFile, MediaWiki\FileRepo\File\LocalFile, and MediaWiki\FileRepo\File\UnregisteredLocalFile.
Definition at line 903 of file File.php.
Referenced by checkExtensionCompatibility(), generateThumbName(), getHandler(), getIsSafeFileUncached(), and getViewURL().
| MediaWiki\FileRepo\File\File::getName | ( | ) |
Return the name of this file.
Definition at line 348 of file File.php.
References $name, and assertRepoDefined().
Referenced by MediaWiki\FileRepo\File\LocalFile\acquireFileIdFromName(), compare(), MediaWiki\FileRepo\LocalRepo\findFiles(), MediaWiki\FileRepo\ThumbnailEntryPoint\generateThumbnail(), MediaWiki\FileRepo\File\LocalFile\getCacheKey(), getDescriptionText(), MediaWiki\FileRepo\File\ForeignDBFile\getDescriptionText(), getDescriptionUrl(), getExtension(), MediaWiki\FileRepo\File\LocalFile\getFileIdFromName(), getHashPath(), getRel(), getSourcePartOfThumbName(), getThumbDisposition(), MediaWiki\FileRepo\File\ForeignAPIFile\getThumbnails(), getThumbnailSource(), MediaWiki\FileRepo\ForeignAPIRepo\getThumbUrlFromCache(), MediaWiki\FileRepo\File\ForeignAPIFile\getThumbUrlFromInfo(), getTransformScript(), getUrlRel(), getViewURL(), MediaWiki\Page\ImageHistoryList\imageHistoryLine(), MediaWiki\FileRepo\File\LocalFile\loadFromDB(), MediaWiki\FileRepo\File\LocalFile\publishTo(), PurgeChangedFiles\purgeFromArchiveTable(), MediaWiki\FileRepo\File\LocalFile\purgeThumbList(), MediaWiki\FileRepo\File\ForeignAPIFile\purgeThumbnails(), MediaWiki\FileRepo\File\LocalFile\readOnlyFatalStatus(), MediaWiki\FileRepo\File\OldLocalFile\recordOldUpload(), MediaWiki\FileRepo\File\LocalFile\upgradeRow(), and MediaWiki\FileRepo\File\OldLocalFile\upgradeRow().
| MediaWiki\FileRepo\File\File::getOriginalTitle | ( | ) |
Return the title used to find this file.
Definition at line 387 of file File.php.
References $title, and getRedirectedTitle().
| MediaWiki\FileRepo\File\File::getPath | ( | ) |
Return the storage path to the file.
Note that this does not mean that a file actually exists under that location.
This path depends on whether directory hashing is active or not, 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.
Reimplemented in MediaWiki\FileRepo\File\ForeignAPIFile.
Definition at line 516 of file File.php.
References $path, assertRepoDefined(), and getRel().
Referenced by MediaWiki\FileRepo\File\LocalFile\acquireFileLock(), exists(), getLocalRefPath(), getSha1(), getTimestamp(), and MediaWiki\FileRepo\File\LocalFile\releaseFileLock().
| MediaWiki\FileRepo\File\File::getRedirected | ( | ) |
Definition at line 2552 of file File.php.
References return.
Referenced by MediaWiki\Api\ApiDelete\canDeleteFile().
|
protected |
Definition at line 2559 of file File.php.
References MediaWiki\Deferred\LinksUpdate\GenericPageLinksTable\makeTitle(), and NS_FILE.
Referenced by getOriginalTitle().
| MediaWiki\FileRepo\File\File::getRel | ( | ) |
Get the path of the file relative to the public zone root.
This function is overridden in OldLocalFile to be like getArchiveRel().
Reimplemented in MediaWiki\FileRepo\File\OldLocalFile.
Definition at line 1811 of file File.php.
References getHashPath(), and getName().
Referenced by getPath(), getThumbRel(), and MediaWiki\FileRepo\File\LocalFile\publish().
| MediaWiki\FileRepo\File\File::getRepo | ( | ) |
Returns the repository.
Reimplemented in MediaWiki\FileRepo\File\ForeignAPIFile, MediaWiki\FileRepo\File\ForeignDBFile, and MediaWiki\FileRepo\File\LocalFile.
Definition at line 2159 of file File.php.
Referenced by MediaWiki\FileRepo\ThumbnailEntryPoint\generateThumbnail(), and MediaWiki\Page\ImagePage\imageDupes().
| MediaWiki\FileRepo\File\File::getRepoName | ( | ) |
Returns the name of the repository.
Definition at line 2149 of file File.php.
Referenced by MediaWiki\FileRepo\File\ForeignAPIFile\getUploader().
| MediaWiki\FileRepo\File\File::getSha1 | ( | ) |
Get the SHA-1 base 36 hash of the file.
Reimplemented in MediaWiki\FileRepo\File\ForeignAPIFile, MediaWiki\FileRepo\File\LocalFile, and MediaWiki\Upload\UploadStashFile.
Definition at line 2447 of file File.php.
References assertRepoDefined(), and getPath().
Referenced by MediaWiki\Media\FormatMetadata\fetchExtendedMetadata(), MediaWiki\FileRepo\ThumbnailEntryPoint\generateThumbnail(), generateThumbName(), MediaWiki\Media\DjVuHandler\getDimensionInfo(), and getStorageKey().
| MediaWiki\FileRepo\File\File::getShortDesc | ( | Language | $lang | ) |
Short description.
Shown on Special:Search results.
Until MediaWiki 1.45, the return value was poorly documented, and some handlers returned HTML while others returned plain text. When calling this method, you should treat it as returning unsafe HTML, and call Sanitizer::removeSomeTags() on the result.
| Language | $lang | User language to return the description in (since 1.46) |
Definition at line 2526 of file File.php.
References $handler, and getHandler().
| MediaWiki\FileRepo\File\File::getSize | ( | ) |
Return the size of the image file, in bytes Overridden by LocalFile, UnregisteredLocalFile STUB.
Reimplemented in MediaWiki\FileRepo\File\ForeignAPIFile, MediaWiki\FileRepo\File\LocalFile, and MediaWiki\FileRepo\File\UnregisteredLocalFile.
Definition at line 891 of file File.php.
Referenced by MediaWiki\Media\SvgHandler\getLongDesc(), and getThumbnailSource().
|
protected |
Get the source part of the thumb name, which may either be the name of the file, or an abbreviation with the same extension.
UploadStashFile overrides this to use the stash key.
| int | $flags | See thumbName() |
Reimplemented in MediaWiki\Upload\UploadStashFile.
Definition at line 1150 of file File.php.
References getName().
Referenced by thumbName().
| MediaWiki\FileRepo\File\File::getStorageKey | ( | ) |
Get the deletion archive key, "<sha1>.<ext>".
Definition at line 2458 of file File.php.
References getExtension(), and getSha1().
| MediaWiki\FileRepo\File\File::getThumbDisposition | ( | $thumbName, | |
| $dispositionType = 'inline' ) |
| string | $thumbName | Thumbnail name |
| string | $dispositionType | Type of disposition (either "attachment" or "inline") |
Definition at line 1628 of file File.php.
References Wikimedia\FileBackend\FileBackend\extensionFromPath(), getExtension(), getName(), and Wikimedia\FileBackend\FileBackend\makeContentDisposition().
Referenced by generateAndSaveThumb().
| MediaWiki\FileRepo\File\File::getThumbnailBucket | ( | $desiredWidth, | |
| $page = 1 ) |
Return the smallest bucket from $wgThumbnailBuckets which is at least $wgThumbnailMinimumBucketDistance larger than $desiredWidth.
The returned bucket, if any, will always be bigger than $desiredWidth.
| int | $desiredWidth | |
| int | $page |
Definition at line 601 of file File.php.
References MediaWiki\MediaWikiServices\getInstance(), getWidth(), MediaWiki\MainConfigNames\ThumbnailBuckets, and MediaWiki\MainConfigNames\ThumbnailMinimumBucketDistance.
Referenced by generateBucketsIfNeeded(), and getThumbnailSource().
|
protected |
Get all thumbnail names previously generated for this file STUB Overridden by LocalFile.
Reimplemented in MediaWiki\FileRepo\File\ForeignAPIFile.
| MediaWiki\FileRepo\File\File::getThumbnailSource | ( | $params | ) |
Returns the most appropriate source image for the thumbnail, given a target thumbnail size.
| array | $params |
Definition at line 1532 of file File.php.
References $fsFile, getBucketThumbPath(), getHandler(), getHeight(), getLocalRefPath(), getName(), getSize(), getThumbnailBucket(), and getWidth().
| MediaWiki\FileRepo\File\File::getThumbPath | ( | $suffix = false | ) |
Get the path of the thumbnail directory, or a particular file if $suffix is specified.
| string | false | $suffix | If not false, the name of a thumbnail file |
Reimplemented in MediaWiki\FileRepo\File\ForeignAPIFile, and MediaWiki\Upload\UploadStashFile.
Definition at line 1912 of file File.php.
References assertRepoDefined(), and getThumbRel().
Referenced by generateAndSaveThumb(), getBucketThumbPath(), MediaWiki\FileRepo\File\LocalFile\getThumbnails(), and transform().
| MediaWiki\FileRepo\File\File::getThumbRel | ( | $suffix = false | ) |
Get the path, relative to the thumbnail zone root, of the thumbnail directory or a particular file if $suffix is specified.
| string | false | $suffix | If not false, the name of a thumbnail file |
Definition at line 1842 of file File.php.
References $path, and getRel().
Referenced by getThumbPath(), and getTranscodedPath().
| MediaWiki\FileRepo\File\File::getThumbUrl | ( | $suffix = false | ) |
Get the URL of the thumbnail directory, or a particular file if $suffix is specified.
| string | false | $suffix | If not false, the name of a thumbnail file |
Reimplemented in MediaWiki\Upload\UploadStashFile.
Definition at line 1995 of file File.php.
Referenced by generateAndSaveThumb(), MediaWiki\JobQueue\Jobs\ThumbnailRenderJob\hitThumbUrl(), MediaWiki\FileRepo\File\LocalFile\purgeThumbnails(), and transform().
| MediaWiki\FileRepo\File\File::getThumbVirtualUrl | ( | $suffix = false | ) |
Get the virtual URL for a thumbnail file or directory.
| string | false | $suffix | If not false, the name of a thumbnail file |
Definition at line 2077 of file File.php.
References $path, assertRepoDefined(), and getUrlRel().
| MediaWiki\FileRepo\File\File::getTimestamp | ( | ) |
Get the 14-character timestamp of the file upload.
Reimplemented in MediaWiki\FileRepo\File\ForeignAPIFile, and MediaWiki\FileRepo\File\LocalFile.
Definition at line 2423 of file File.php.
References assertRepoDefined(), and getPath().
Referenced by MediaWiki\FileRepo\LocalRepo\findFiles(), MediaWiki\Media\FormatMetadata\getExtendedMetadataFromFile(), and modifyClientThumbUrl().
| MediaWiki\FileRepo\File\File::getTitle | ( | ) |
Return the associated title object.
Definition at line 378 of file File.php.
References $title.
Referenced by MediaWiki\FileRepo\LocalRepo\findFiles(), MediaWiki\FileRepo\File\LocalFile\getDescriptionText(), MediaWiki\Media\FormatMetadata\getExtendedMetadataFromFile(), MediaWiki\Page\ImagePage\imageDupes(), MediaWiki\FileRepo\File\LocalFile\invalidateCache(), MediaWiki\FileRepo\File\LocalFile\prerenderThumbnails(), purgeDescription(), purgeEverything(), PurgeChangedFiles\purgeFromArchiveTable(), and wasDeleted().
| MediaWiki\FileRepo\File\File::getTranscodedPath | ( | $suffix = false | ) |
Get the path of the transcoded directory, or a particular file if $suffix is specified.
| string | false | $suffix | If not false, the name of a media file |
Definition at line 1924 of file File.php.
References assertRepoDefined(), and getThumbRel().
| MediaWiki\FileRepo\File\File::getTranscodedUrl | ( | $suffix = false | ) |
|
protected |
Reimplemented in MediaWiki\Upload\UploadStashFile.
Definition at line 1087 of file File.php.
References getName(), and wfAppendQuery().
Referenced by transform().
| MediaWiki\FileRepo\File\File::getUnscaledThumb | ( | $handlerParams = [] | ) |
Get a ThumbnailImage which is the same size as the source.
| array | $handlerParams |
Definition at line 1108 of file File.php.
References getWidth(), iconThumb(), and transform().
| MediaWiki\FileRepo\File\File::getUploader | ( | int | $audience = self::FOR_PUBLIC, |
| ?Authority | $performer = null ) |
Get the identity of the file uploader.
| int | $audience | One of: File::FOR_PUBLIC to be displayed to all users File::FOR_THIS_USER to be displayed to the given user File::RAW get the description regardless of permissions |
| Authority | null | $performer | to check for, only if FOR_THIS_USER is passed to the $audience parameter |
Reimplemented in MediaWiki\FileRepo\File\ForeignAPIFile, and MediaWiki\FileRepo\File\LocalFile.
Definition at line 2396 of file File.php.
References return.
Referenced by MediaWiki\Upload\UploadBase\userCanReUpload().
| MediaWiki\FileRepo\File\File::getUrl | ( | ) |
Return the URL to the original file.
Reimplemented in MediaWiki\FileRepo\File\ForeignAPIFile, and MediaWiki\Upload\UploadStashFile.
Definition at line 401 of file File.php.
References appendRequestProvenance(), assertRepoDefined(), getExtension(), and getUrlRel().
Referenced by MediaWiki\RevisionDelete\RevDelFileItem\getApiData(), getCanonicalUrl(), getFullUrl(), and getViewURL().
| MediaWiki\FileRepo\File\File::getUrlRel | ( | ) |
Get urlencoded path of the file relative to the public zone root.
This function is overridden in OldLocalFile to be like getArchiveUrl().
Reimplemented in MediaWiki\FileRepo\File\OldLocalFile.
Definition at line 1858 of file File.php.
References getHashPath(), and getName().
Referenced by getThumbVirtualUrl(), getUrl(), and getVirtualUrl().
| MediaWiki\FileRepo\File\File::getViewURL | ( | ) |
Definition at line 487 of file File.php.
References canRender(), createThumb(), getMimeType(), getName(), getUrl(), getWidth(), mustRender(), and wfDebug().
| MediaWiki\FileRepo\File\File::getVirtualUrl | ( | $suffix = false | ) |
Get the public zone virtual URL for a current version source file.
| string | false | $suffix | If not false, the name of a thumbnail file |
Definition at line 2041 of file File.php.
References $path, assertRepoDefined(), and getUrlRel().
Referenced by addToShellboxCommand(), MediaWiki\FileRepo\File\LocalFile\isMissing(), and MediaWiki\FileRepo\File\LocalFile\loadFromFile().
| MediaWiki\FileRepo\File\File::getVisibility | ( | ) |
Return the deletion bitfield STUB.
Reimplemented in MediaWiki\FileRepo\File\OldLocalFile.
| MediaWiki\FileRepo\File\File::getWidth | ( | $page = 1 | ) |
Return the width of the image.
Returns false if the width is unknown or undefined.
STUB Overridden by LocalFile, UnregisteredLocalFile
| int | $page |
Reimplemented in MediaWiki\FileRepo\File\ForeignAPIFile, MediaWiki\FileRepo\File\LocalFile, and MediaWiki\FileRepo\File\UnregisteredLocalFile.
Definition at line 573 of file File.php.
Referenced by getDisplayWidthHeight(), MediaWiki\Media\ImageHandler\getImageArea(), MediaWiki\Media\SvgHandler\getLongDesc(), MediaWiki\Media\ImageHandler\getScriptedTransform(), getThumbnailBucket(), getThumbnailSource(), getUnscaledThumb(), and getViewURL().
| MediaWiki\FileRepo\File\File::iconThumb | ( | ) |
Get a ThumbnailImage representing a file type icon.
Definition at line 1664 of file File.php.
References $IP, getExtension(), MediaWiki\MediaWikiServices\getInstance(), and MediaWiki\MainConfigNames\ResourceBasePath.
Referenced by getUnscaledThumb(), and transform().
| MediaWiki\FileRepo\File\File::isCacheable | ( | ) |
Check if this file object is small and can be cached.
Reimplemented in MediaWiki\FileRepo\File\LocalFile.
| MediaWiki\FileRepo\File\File::isDeleted | ( | $field | ) |
Is this file a "deleted" file in a private archive?
STUB
| int | $field | One of DELETED_* bitfield constants |
Reimplemented in MediaWiki\FileRepo\File\OldLocalFile.
Definition at line 2182 of file File.php.
Referenced by MediaWiki\Media\FormatMetadata\fetchExtendedMetadata(), MediaWiki\FileRepo\LocalRepo\findFiles(), MediaWiki\FileRepo\File\LocalFile\getDescription(), and MediaWiki\FileRepo\File\LocalFile\getUploader().
| MediaWiki\FileRepo\File\File::isExpensiveToThumbnail | ( | ) |
True if creating thumbnails from the file is large or otherwise resource-intensive.
Definition at line 2615 of file File.php.
References $handler, and getHandler().
Referenced by MediaWiki\FileRepo\ThumbnailEntryPoint\generateThumbnail().
|
protected |
| MediaWiki\FileRepo\File\File::isLocal | ( | ) |
Returns true if the file comes from the local file repository.
Definition at line 2140 of file File.php.
Referenced by MediaWiki\Api\ApiDelete\canDeleteFile(), and MediaWiki\Page\ImagePage\imageDupes().
| MediaWiki\FileRepo\File\File::isMissing | ( | ) |
| MediaWiki\FileRepo\File\File::isMultipage | ( | ) |
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.
Definition at line 2272 of file File.php.
References getHandler().
Referenced by MediaWiki\FileRepo\File\LocalFile\getHeight(), MediaWiki\FileRepo\File\LocalFile\getWidth(), and MediaWiki\FileRepo\File\LocalFile\prerenderThumbnails().
| MediaWiki\FileRepo\File\File::isOld | ( | ) |
Returns true if the image is an old version STUB.
Reimplemented in MediaWiki\FileRepo\File\OldLocalFile.
Definition at line 2170 of file File.php.
Referenced by MediaWiki\FileRepo\LocalRepo\findFiles(), and MediaWiki\FileRepo\File\LocalFile\publishTo().
| MediaWiki\FileRepo\File\File::isSafeFile | ( | ) |
Determines if this media file is in a format that is unlikely to contain viruses or malicious content.
It uses the global $wgTrustedMediaFormats list to determine if the file is safe.
This is used to show a warning on the description page of non-safe files. It may also be used to disallow direct [[media:...]] links to such files.
Note that this function will always return true if allowInlineDisplay() or isTrustedFile() is true for this file.
Definition at line 979 of file File.php.
References getIsSafeFileUncached(), and isSafeFile().
Referenced by getIsSafeFile(), and isSafeFile().
| MediaWiki\FileRepo\File\File::isTransformedLocally | ( | ) |
Whether the thumbnails created on the same server as this code is running.
Reimplemented in MediaWiki\FileRepo\File\ForeignAPIFile.
|
protected |
Returns true if the file is flagged as trusted.
Files flagged that way can be linked to directly, even if that is not allowed for this type of file normally.
This is a dummy function right now and always returns false. It could be implemented to extract a flag from the database. The trusted flag could be set on upload, if the user has sufficient privileges, to bypass script- and html-filters. It may even be coupled with cryptographic signatures or such.
Definition at line 1042 of file File.php.
Referenced by getIsSafeFileUncached().
| MediaWiki\FileRepo\File\File::isVectorized | ( | ) |
Return true if the file is vectorized.
Definition at line 697 of file File.php.
References $handler, getHandler(), and MediaWiki\Media\MediaHandler\isVectorized().
Referenced by MediaWiki\FileRepo\File\LocalFile\prerenderThumbnails().
| MediaWiki\FileRepo\File\File::isVisible | ( | ) |
Returns true if file exists in the repository and can be included in a page.
It would be unsafe to include private images, making public thumbnails inadvertently
Reimplemented in MediaWiki\FileRepo\File\OldLocalFile.
Definition at line 1080 of file File.php.
References exists().
| MediaWiki\FileRepo\File\File::load | ( | $flags = 0 | ) |
Load any lazy-loaded file object fields from source.
This is only useful when setting $flags
Overridden by LocalFile to actually query the DB
| int | $flags | Bitfield of IDBAccessObject::READ_* constants |
Reimplemented in MediaWiki\FileRepo\File\LocalFile.
|
protected |
Creates a temp FS file with the same extension and the thumbnail.
| string | $thumbPath | Thumbnail path |
Definition at line 1617 of file File.php.
References Wikimedia\FileBackend\FileBackend\extensionFromPath(), and MediaWiki\MediaWikiServices\getInstance().
Referenced by generateBucketsIfNeeded(), and transform().
| MediaWiki\FileRepo\File\File::modifyClientThumbUrl | ( | $url, | |
| $handlerParams ) |
Append URL query parameters to a thumbnail URL that are intended to be processed by the browser viewing the final page, or by some proxy, but not by the media handler or the thumbnail server.
Currently used to add a cache-busting parameter to the thumbnails on file description pages.
| string | $url | Thumbnail URL (may point to an original file too) |
| array | $handlerParams | Media handler parameters |
Definition at line 2011 of file File.php.
References $url, appendRequestProvenance(), getTimestamp(), and wfAppendQuery().
Referenced by generateAndSaveThumb(), and transform().
| MediaWiki\FileRepo\File\File::move | ( | $target | ) |
Move file to the new title.
Move current, old version and all thumbnails to the new filename. Old file is deleted.
Cache purging is done; checks for validity and logging are caller's responsibility
| Title | $target | New file name |
Reimplemented in MediaWiki\FileRepo\File\ForeignDBFile, and MediaWiki\FileRepo\File\LocalFile.
Definition at line 2220 of file File.php.
References readOnlyError().
| MediaWiki\FileRepo\File\File::mustRender | ( | ) |
Return true if the file is of a type that can't be directly rendered by typical browsers and needs to be re-rasterized.
This returns true for everything but the bitmap types supported by all browsers, i.e. JPEG; GIF and PNG. It will also return true for any non-image formats.
Definition at line 953 of file File.php.
References getHandler().
Referenced by MediaWiki\Media\ImageHandler\getScriptedTransform(), and getViewURL().
| MediaWiki\FileRepo\File\File::nextHistoryLine | ( | ) |
Return the history of this file, line by line.
Starts with current version, then old versions. Should return an object similar to an image/oldimage database row.
STUB
Reimplemented in MediaWiki\FileRepo\File\LocalFile.
|
static |
Normalize a file extension to the common form, making it lowercase and checking some synonyms, and ensure it's clean.
Extensions with non-alphanumeric characters will be discarded. Keep in sync with mw.Title.normalizeExtension() in JS.
| string | $extension | File extension (without the leading dot) |
Definition at line 270 of file File.php.
References $extension.
Referenced by checkExtensionCompatibility(), and getExtension().
|
static |
Given a string or Title object return either a valid Title object with namespace NS_FILE or null.
| PageIdentity | LinkTarget | string | $title | |
| string | false | $exception | Use 'exception' to throw an error on bad titles |
Definition at line 221 of file File.php.
References $title, NS_FILE, and NS_MEDIA.
Referenced by MediaWiki\FileRepo\File\ArchivedFile\__construct(), __construct(), and MediaWiki\FileRepo\File\UnregisteredLocalFile\__construct().
| MediaWiki\FileRepo\File\File::pageCount | ( | ) |
Returns the number of pages of a multipage document, or false for documents which aren't multipage documents.
Definition at line 2283 of file File.php.
References getHandler(), and pageCount().
Referenced by MediaWiki\Media\MediaHandler\getEntireText(), pageCount(), and MediaWiki\FileRepo\File\LocalFile\prerenderThumbnails().
| MediaWiki\FileRepo\File\File::parseThumbName | ( | string | $name, |
| int | $flags = 0 ) |
Invert thumbName(), extracting a parameter array from a string of the form "<params>-<source>" or "<params>-thumbnail.<ext>".
If the string can't be parsed or is not canonical, return null.
| string | $name | The thumb name |
| int | $flags | If this bitfield contains self::THUMB_FULL_NAME, the unabbreviated name will be used unconditionally. |
Definition at line 1199 of file File.php.
References $handler, $name, and getHandler().
| MediaWiki\FileRepo\File\File::publish | ( | $src, | |
| $flags = 0, | |||
| array | $options = [] ) |
Move or copy a file to its public location.
If a file exists at the destination, move it to an archive. Returns a Status object with the archive name in the "value" member on success.
The archive name should be passed through to recordUpload3 for database registration.
Options to $options include:
| string | FSFile | $src | Local filesystem path to the source image |
| int | $flags | A bitwise combination of: File::DELETE_SOURCE Delete the source file, i.e. move rather than copy |
| array | $options | Optional additional parameters |
STUB Overridden by LocalFile
Reimplemented in MediaWiki\FileRepo\File\ForeignDBFile, and MediaWiki\FileRepo\File\LocalFile.
Definition at line 2122 of file File.php.
References readOnlyError().
| MediaWiki\FileRepo\File\File::purgeCache | ( | $options = [] | ) |
Purge shared caches such as thumbnails and DB data caching STUB Overridden by LocalFile.
| array | $options | Options, which include: 'forThumbRefresh' : The purging is only to refresh thumbnails |
Reimplemented in MediaWiki\FileRepo\File\ForeignAPIFile, and MediaWiki\FileRepo\File\LocalFile.
Definition at line 1711 of file File.php.
Referenced by purgeEverything().
| MediaWiki\FileRepo\File\File::purgeDescription | ( | ) |
Purge the file description page, but don't go after pages using the file.
Use when modifying file history but not the current data.
Definition at line 1719 of file File.php.
References $title, MediaWiki\MediaWikiServices\getInstance(), and getTitle().
Referenced by MediaWiki\FileRepo\File\LocalFile\deleteOldFile(), and purgeEverything().
| MediaWiki\FileRepo\File\File::purgeEverything | ( | ) |
Purge metadata and all affected pages when the file is created, deleted, or majorly updated.
Definition at line 1732 of file File.php.
References $job, $title, MediaWiki\MediaWikiServices\getInstance(), getTitle(), purgeCache(), and purgeDescription().
Referenced by MediaWiki\FileRepo\File\LocalFile\deleteFile().
|
protected |
Definition at line 2096 of file File.php.
Referenced by deleteFile(), MediaWiki\FileRepo\File\ForeignDBFile\deleteFile(), move(), MediaWiki\FileRepo\File\ForeignDBFile\move(), publish(), MediaWiki\FileRepo\File\ForeignDBFile\publish(), restore(), and MediaWiki\FileRepo\File\ForeignDBFile\restore().
| MediaWiki\FileRepo\File\File::redirectedFrom | ( | string | $from | ) |
| string | $from | The name that was used to access the file, before resolving redirects. |
Definition at line 2572 of file File.php.
Referenced by MediaWiki\FileRepo\LocalRepo\findFiles().
| MediaWiki\FileRepo\File\File::resetHistory | ( | ) |
Reset the history pointer to the first element of the history.
Always call this function after using nextHistoryLine() to free db resources STUB Overridden in LocalFile.
Reimplemented in MediaWiki\FileRepo\File\LocalFile.
| MediaWiki\FileRepo\File\File::restore | ( | $versions = [], | |
| $unsuppress = false ) |
Restore all or specified deleted revisions to the given file.
Permissions and logging are left to the caller.
May throw database exceptions on error.
| int[] | $versions | Set of record ids of deleted items to restore, or empty to restore all revisions. |
| bool | $unsuppress | Remove restrictions on content upon restoration? |
Reimplemented in MediaWiki\FileRepo\File\ForeignDBFile, and MediaWiki\FileRepo\File\LocalFile.
Definition at line 2260 of file File.php.
References readOnlyError().
|
static |
Calculate the height of a thumbnail using the source and destination width.
| int | $srcWidth | |
| int | $srcHeight | |
| int | $dstWidth |
Definition at line 2304 of file File.php.
Referenced by MediaWiki\FileRepo\File\ForeignAPIFile\transform().
| MediaWiki\FileRepo\File\File::setHandlerState | ( | string | $key, |
| $value ) |
|
static |
Split an internet media type into its two components; if not a two-part name, set the minor type to 'unknown'.
| ?string | $mime | "text/html" etc |
Definition at line 321 of file File.php.
Referenced by MediaWiki\FileRepo\File\LocalFileRestoreBatch\execute().
| MediaWiki\FileRepo\File\File::thumbName | ( | $params, | |
| $flags = 0 ) |
Return the file name of a thumbnail with the specified parameters.
Use File::THUMB_FULL_NAME to always get a name like "<params>-<source>". Otherwise, the format may be "<params>-<source>" or "<params>-thumbnail.<ext>".
The parameters used here must be the same as those used by media handlers' implementation of MediaHandler::doTransform. Otherwise, the decision of whether thumbnailing is needed may be wrong, and the actual size of the thumbnail generated may not match the name (T415598).
| array | $params | Handler-specific parameters |
| int | $flags | If this bitfield contains self::THUMB_FULL_NAME, force the use of an unabbreviated name for backwards compatibility. |
Definition at line 1138 of file File.php.
References generateThumbName(), and getSourcePartOfThumbName().
Referenced by generateAndSaveThumb(), getBucketThumbName(), MediaWiki\JobQueue\Jobs\ThumbnailRenderJob\hitThumbUrl(), and transform().
| MediaWiki\FileRepo\File\File::transform | ( | $params, | |
| $flags = 0 ) |
Transform a media file.
| array | $params | An associative array of handler-specific parameters. Typical keys are width, height and page. |
| int | $flags | A bitfield, may contain self::RENDER_NOW to force rendering |
Reimplemented in MediaWiki\FileRepo\File\ForeignAPIFile.
Definition at line 1292 of file File.php.
References $handler, canRender(), generateAndSaveThumb(), getDescriptionUrl(), getHandler(), MediaWiki\MediaWikiServices\getInstance(), getThumbPath(), getThumbUrl(), getTransformScript(), iconThumb(), makeTransformTmpFile(), modifyClientThumbUrl(), PROTO_CANONICAL, MediaWiki\MainConfigNames\ThumbnailEpoch, thumbName(), transformErrorOutput(), wfDebug(), and wfMessage().
Referenced by createThumb(), MediaWiki\FileRepo\ThumbnailEntryPoint\generateThumbnail(), and getUnscaledThumb().
|
protected |
Return either a MediaTransformError or placeholder thumbnail (if $wgIgnoreImageErrors).
| string | $thumbPath | Thumbnail storage path |
| string | $thumbUrl | Thumbnail URL |
| array | $params | |
| int | $flags |
Definition at line 1270 of file File.php.
References $handler, getHandler(), MediaWiki\MediaWikiServices\getInstance(), MediaWiki\MainConfigNames\IgnoreImageErrors, and wfMessage().
Referenced by generateAndSaveThumb(), and transform().
| MediaWiki\FileRepo\File\File::upgradeRow | ( | ) |
Upgrade the database row if there is one Called by ImagePage STUB.
Reimplemented in MediaWiki\FileRepo\File\LocalFile, and MediaWiki\FileRepo\File\OldLocalFile.
| MediaWiki\FileRepo\File\File::userCan | ( | $field, | |
| Authority | $performer ) |
Determine if the current user is allowed to view a particular field of this file, if it's marked as deleted.
STUB
| int | $field | |
| Authority | $performer | user object to check |
Reimplemented in MediaWiki\FileRepo\File\OldLocalFile.
Definition at line 2478 of file File.php.
Referenced by MediaWiki\FileRepo\LocalRepo\findFiles(), and MediaWiki\FileRepo\File\LocalFile\getDescription().
| MediaWiki\FileRepo\File\File::wasDeleted | ( | ) |
Was this file ever deleted from the wiki?
Definition at line 2201 of file File.php.
References $title, and getTitle().
|
protected |
|
protected |
File extension.
Definition at line 154 of file File.php.
Referenced by generateThumbName(), getExtension(), and normalizeExtension().
|
protected |
False if undefined.
Definition at line 145 of file File.php.
Referenced by getThumbnailSource(), and MediaWiki\FileRepo\File\UnregisteredLocalFile\setLocalReference().
|
protected |
Definition at line 148 of file File.php.
Referenced by canAnimateThumbIfAppropriate(), convertMetadataVersion(), formatMetadata(), generateAndSaveThumb(), getAvailableLanguages(), getCommonMetaArray(), getContentHeaders(), getDefaultRenderLanguage(), getDimensionsString(), MediaWiki\FileRepo\File\LocalFile\getHeight(), getLength(), getLongDesc(), getMatchedLanguage(), getShortDesc(), MediaWiki\FileRepo\File\LocalFile\getWidth(), isExpensiveToThumbnail(), isVectorized(), MediaWiki\FileRepo\File\LocalFile\maybeUpgradeRow(), parseThumbName(), MediaWiki\FileRepo\File\ForeignAPIFile\purgeThumbnails(), MediaWiki\FileRepo\File\LocalFile\purgeThumbnails(), transform(), transformErrorOutput(), and MediaWiki\FileRepo\File\LocalFile\upload().
|
protected |
|
protected |
|
protected |
|
protected |
The name of a file from its title object.
Definition at line 157 of file File.php.
Referenced by __get(), generateThumbName(), getName(), MediaWiki\FileRepo\File\OldLocalFile\loadExtraFromDB(), parseThumbName(), and MediaWiki\FileRepo\File\LocalFile\unprefixRow().
|
protected |
|
protected |
The storage path corresponding to one of the zones.
Definition at line 160 of file File.php.
Referenced by getArchiveRel(), getArchiveThumbUrl(), getArchiveUrl(), getArchiveVirtualUrl(), getPath(), MediaWiki\FileRepo\File\ForeignAPIFile\getThumbPath(), getThumbRel(), getThumbVirtualUrl(), getVirtualUrl(), and MediaWiki\FileRepo\File\LocalFile\loadFromFile().
|
protected |
|
protected |
|
protected |
| FileRepo LocalRepo ForeignAPIRepo false MediaWiki\FileRepo\File\File::$repo |
Some member variables can be lazy-initialised using __get().
The initialisation function for these variables is always a function named like getVar(), where Var is the variable name with upper-case first letter.
The following variables are initialised in this way in this base class: name, extension, handler, path, canRender, isSafeFile, transformScript, hashPath, pageCount, url
Code within this class should generally use the accessor function directly, since __get() isn't re-entrant and therefore causes bugs that depend on initialisation order. The following member variables are not lazy-initialised
Definition at line 127 of file File.php.
Referenced by __construct(), MediaWiki\FileRepo\File\ForeignAPIFile\__construct(), MediaWiki\FileRepo\File\LocalFile\__construct(), MediaWiki\FileRepo\File\OldLocalFile\__construct(), MediaWiki\FileRepo\File\UnregisteredLocalFile\__construct(), MediaWiki\Upload\UploadStashFile\__construct(), MediaWiki\FileRepo\File\ForeignAPIFile\getRepo(), MediaWiki\FileRepo\File\ForeignDBFile\getRepo(), MediaWiki\FileRepo\File\OldLocalFile\newFromArchiveName(), MediaWiki\FileRepo\File\LocalFile\newFromKey(), MediaWiki\FileRepo\File\OldLocalFile\newFromKey(), MediaWiki\FileRepo\File\LocalFile\newFromRow(), MediaWiki\FileRepo\File\OldLocalFile\newFromRow(), MediaWiki\FileRepo\File\ForeignAPIFile\newFromTitle(), MediaWiki\FileRepo\File\LocalFile\newFromTitle(), MediaWiki\FileRepo\File\OldLocalFile\newFromTitle(), MediaWiki\FileRepo\File\UnregisteredLocalFile\newFromTitle(), and MediaWiki\FileRepo\File\LocalFile\publishTo().
|
protected |
|
protected |
Definition at line 130 of file File.php.
Referenced by __construct(), MediaWiki\FileRepo\File\ForeignAPIFile\__construct(), MediaWiki\FileRepo\File\LocalFile\__construct(), MediaWiki\FileRepo\File\OldLocalFile\__construct(), getOriginalTitle(), getTitle(), MediaWiki\FileRepo\File\LocalFile\invalidateCache(), MediaWiki\FileRepo\File\OldLocalFile\newFromArchiveName(), MediaWiki\FileRepo\File\LocalFile\newFromRow(), MediaWiki\FileRepo\File\OldLocalFile\newFromRow(), MediaWiki\FileRepo\File\ForeignAPIFile\newFromTitle(), MediaWiki\FileRepo\File\LocalFile\newFromTitle(), MediaWiki\FileRepo\File\OldLocalFile\newFromTitle(), normalizeTitle(), purgeDescription(), purgeEverything(), and wasDeleted().
|
protected |
|
protected |
|
protected |
The URL corresponding to one of the four basic zones.
Definition at line 151 of file File.php.
Referenced by appendRequestProvenance(), MediaWiki\FileRepo\File\LocalFile\deleteOldFile(), MediaWiki\FileRepo\File\ForeignAPIFile\getDescriptionShortUrl(), MediaWiki\FileRepo\File\ForeignDBFile\getDescriptionShortUrl(), MediaWiki\FileRepo\File\LocalFile\getDescriptionShortUrl(), and modifyClientThumbUrl().
| const MediaWiki\FileRepo\File\File::DELETE_SOURCE = 1 |
Definition at line 97 of file File.php.
Referenced by MediaWiki\FileRepo\File\LocalFile\publishTo().
| const MediaWiki\FileRepo\File\File::DELETED_COMMENT = 2 |
Definition at line 85 of file File.php.
Referenced by MediaWiki\FileRepo\File\ArchivedFile\getDescription(), and MediaWiki\Page\ImageHistoryList\imageHistoryLine().
| const MediaWiki\FileRepo\File\File::DELETED_FILE = 1 |
Definition at line 84 of file File.php.
Referenced by MediaWiki\FileRepo\File\LocalFileMoveBatch\addOlds(), DeleteArchivedFiles\execute(), MediaWiki\FileRepo\File\LocalFileRestoreBatch\execute(), MediaWiki\Page\ImageHistoryList\getThumbForLine(), MediaWiki\Page\ImageHistoryList\imageHistoryLine(), and MediaWiki\FileRepo\File\OldLocalFile\isVisible().
| const MediaWiki\FileRepo\File\File::DELETED_RESTRICTED = 8 |
Definition at line 87 of file File.php.
Referenced by MediaWiki\Page\ImageHistoryList\imageHistoryLine().
| const MediaWiki\FileRepo\File\File::DELETED_USER = 4 |
Definition at line 86 of file File.php.
Referenced by MediaWiki\FileRepo\File\ArchivedFile\getUploader().
| const MediaWiki\FileRepo\File\File::FOR_THIS_USER = 2 |
Definition at line 101 of file File.php.
Referenced by MediaWiki\Page\ImageHistoryPseudoPager\getBody(), and MediaWiki\Page\ImageHistoryList\imageHistoryLine().
| const MediaWiki\FileRepo\File\File::RENDER_FORCE = 2 |
| const MediaWiki\FileRepo\File\File::RENDER_NOW = 1 |