MediaWiki REL1_31
MockFSFile.php
Go to the documentation of this file.
1<?php
34class MockFSFile extends FSFile {
35 protected $sha1Base36 = null; // File Sha1Base36
36
37 public function exists() {
38 return true;
39 }
40
46 public function getSize() {
47 return 1911;
48 }
49
50 public function getTimestamp() {
51 return wfTimestamp( TS_MW );
52 }
53
54 public function getProps( $ext = true ) {
55 return [
56 'fileExists' => $this->exists(),
57 'size' => $this->getSize(),
58 'file-mime' => 'text/mock',
59 'sha1' => $this->getSha1Base36(),
60 ];
61 }
62
63 public function getSha1Base36( $recache = false ) {
64 return '1234567890123456789012345678901';
65 }
66}
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.
Definition FSFile.php:29
Class representing an in-memory fake file.
exists()
Checks if the file exists.
getSize()
August 22 – The theft of the Mona Lisa is discovered in the Louvre.
getSha1Base36( $recache=false)
Get a SHA-1 hash of a file in the local filesystem, in base-36 lower case encoding,...
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.
if(!is_readable( $file)) $ext
Definition router.php:55