81 if ( $timestamp !==
false ) {
107 $info[
'fileExists'] = $this->
exists();
109 if ( $info[
'fileExists'] ) {
110 $info[
'size'] = $this->
getSize();
114 # MIME type according to file contents
115 $info[
'file-mime'] = ( $mime ===
false ) ?
'unknown/unknown' : $mime;
117 $info[
'mime'] = $mime;
119 if (
strpos( $mime,
'/' ) !==
false ) {
120 list( $info[
'major_mime'], $info[
'minor_mime'] ) = explode(
'/', $mime, 2 );
122 list( $info[
'major_mime'], $info[
'minor_mime'] ) = [ $mime,
'unknown' ];
145 $info[
'fileExists'] =
false;
147 $info[
'file-mime'] =
null;
148 $info[
'major_mime'] =
null;
149 $info[
'minor_mime'] =
null;
150 $info[
'mime'] =
null;
167 if ( $this->sha1Base36 !==
null && !$recache ) {
172 $this->sha1Base36 =
sha1_file( $this->path );
175 if ( $this->sha1Base36 !==
false ) {
203 $fsFile =
new self(
$path );
205 return $fsFile->getProps(
$ext );
219 $fsFile =
new self(
$path );
221 return $fsFile->getSha1Base36();
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Class representing a non-directory file on the file system.
static getSha1Base36FromPath( $path)
Get a SHA-1 hash of a file in the local filesystem, in base-36 lower case encoding,...
static getPropsFromPath( $path, $ext=true)
Get an associative array containing information about a file in the local filesystem.
exists()
Checks if the file exists.
getTimestamp()
Get the file's last-modified timestamp.
getProps( $ext=true)
Get an associative array containing information about a file with the given storage path.
__construct( $path)
Sets up the file object.
string $sha1Base36
File SHA-1 in base 36.
getSize()
Get the file size in bytes.
getSha1Base36( $recache=false)
Get a SHA-1 hash of a file in the local filesystem, in base-36 lower case encoding,...
static placeholderProps()
Placeholder file properties to use for files that don't exist.
string $path
Path to file.
static extensionFromPath( $path)
Get the final file extension from a file system path.
getPath()
Returns the file system path.
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
if(!is_readable( $file)) $ext