Go to the documentation of this file.
42 $this->fileKey = $key;
52 ( strpos(
$path, $repoTempPath ) !== 0 )
54 wfDebug(
"UploadStash: tried to construct an UploadStashFile "
55 .
"from a file that should already exist at '$path', but path is not valid\n" );
57 wfMessage(
'uploadstash-bad-path-invalid' )
63 wfDebug(
"UploadStash: tried to construct an UploadStashFile from "
64 .
"a file that should already exist at '$path', but path is not found\n" );
66 wfMessage(
'uploadstash-file-not-found-not-exists' )
71 parent::__construct(
false,
$repo,
$path,
false );
73 $this->name = basename( $this->path );
99 $path = dirname( $this->path );
100 if ( $thumbName !==
false ) {
101 $path .=
"/$thumbName";
141 wfDebug( __METHOD__ .
" getting for $thumbName \n" );
153 if ( !$this->urlName ) {
167 if ( !isset( $this->url ) ) {
199 public function remove() {
200 if ( !$this->repo->fileExists( $this->path ) ) {
205 return $this->repo->freeTemp( $this->path );
209 return $this->repo->fileExists( $this->path );
FileRepo LocalRepo ForeignAPIRepo bool $repo
Some member variables can be lazy-initialised using __get().
getUrlName()
The basename for the URL, which we want to not be related to the filename.
validateFilename( $filename)
Determine if a relative path is valid, i.e.
A file object referring to either a standalone local file, or a file in a local repository with no da...
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
getZonePath( $zone)
Get the storage path corresponding to one of the zones.
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
getThumbPath( $thumbName=false)
Get the path for the thumbnail (actually any transformation of this file) The actual argument is the ...
getFullUrl()
Parent classes use this method, for no obvious reason, to return the path (relative to wiki root,...
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
fileExists( $file)
Checks existence of a file.
generateThumbName( $name, $params)
Generate a thumbnail file name from a name and specified parameters.
thumbName( $params, $flags=0)
Return the file/url base name of a thumbnail with the specified parameters.
getDescriptionUrl()
A method needed by the file transforming and scaling routines in File.php We do not necessarily care ...
getSpecialUrl( $subPage)
Helper function – given a 'subpage', return the local URL, e.g.
getFileKey()
Getter for file key (the unique id by which this file's location & metadata is stored in the db)
__construct( $repo, $path, $key)
A LocalFile wrapper around a file that has been temporarily stashed, so we can do things like create ...
exists()
Returns true if file exists in the repository.
getUrl()
Return the URL of the file, if for some reason we wanted to download it We tend not to do this for th...
static isVirtualUrl( $url)
Determine if a string is an mwrepo:// URL.
resolveVirtualUrl( $url)
Get the backend storage path corresponding to a virtual URL.
getThumbUrl( $thumbName=false)
Get a URL to access the thumbnail This is required because the model of how files work requires that ...