[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/includes/filebackend/ -> FSFile.php (summary)

Non-directory file on the file system. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

File Size: 266 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

FSFile:: (13 methods):
  __construct()
  getPath()
  exists()
  getSize()
  getTimestamp()
  getMimeType()
  getProps()
  placeholderProps()
  extractImageSizeInfo()
  getSha1Base36()
  extensionFromPath()
  getPropsFromPath()
  getSha1Base36FromPath()


Class: FSFile  - X-Ref

Class representing a non-directory file on the file system

__construct( $path )   X-Ref
Sets up the file object

param: string $path Path to temporary file on local disk

getPath()   X-Ref
Returns the file system path

return: string

exists()   X-Ref
Checks if the file exists

return: bool

getSize()   X-Ref
Get the file size in bytes

return: int|bool

getTimestamp()   X-Ref
Get the file's last-modified timestamp

return: string|bool TS_MW timestamp or false on failure

getMimeType()   X-Ref
Guess the MIME type from the file contents alone

return: string

getProps( $ext = true )   X-Ref
Get an associative array containing information about
a file with the given storage path.

param: string|bool $ext The file extension, or true to extract it from the filename.
return: array

placeholderProps()   X-Ref
Placeholder file properties to use for files that don't exist

return: array

extractImageSizeInfo( array $gis )   X-Ref
Exract image size information

param: array $gis
return: array

getSha1Base36( $recache = false )   X-Ref
Get a SHA-1 hash of a file in the local filesystem, in base-36 lower case
encoding, zero padded to 31 digits.

160 log 2 / log 36 = 30.95, so the 160-bit hash fills 31 digits in base 36
fairly neatly.

param: bool $recache
return: bool|string False on failure

extensionFromPath( $path )   X-Ref
Get the final file extension from a file system path

param: string $path
return: string

getPropsFromPath( $path, $ext = true )   X-Ref
Get an associative array containing information about a file in the local filesystem.

param: string $path Absolute local filesystem path
param: string|bool $ext The file extension, or true to extract it from the filename.
return: array

getSha1Base36FromPath( $path )   X-Ref
Get a SHA-1 hash of a file in the local filesystem, in base-36 lower case
encoding, zero padded to 31 digits.

160 log 2 / log 36 = 30.95, so the 160-bit hash fills 31 digits in base 36
fairly neatly.

param: string $path
return: bool|string False on failure



Generated: Fri Nov 28 14:03:12 2014 Cross-referenced by PHPXref 0.7.1