MediaWiki REL1_31
MockLocalRepo.php
Go to the documentation of this file.
1<?php
2
9class MockLocalRepo extends LocalRepo {
10 function getLocalCopy( $virtualUrl ) {
11 return new MockFSFile( wfTempDir() . '/' . wfRandomString( 32 ) );
12 }
13
14 function getLocalReference( $virtualUrl ) {
15 return new MockFSFile( wfTempDir() . '/' . wfRandomString( 32 ) );
16 }
17
18 function getFileProps( $virtualUrl ) {
19 $fsFile = $this->getLocalReference( $virtualUrl );
20
21 return $fsFile->getProps();
22 }
23}
wfTempDir()
Tries to get the system directory for temporary files.
wfRandomString( $length=32)
Get a random string containing a number of pseudo-random hex characters.
A repository that stores files in the local filesystem and registers them in the wiki's own database.
Definition LocalRepo.php:35
Class representing an in-memory fake file.
Class simulating a local file repo.
getFileProps( $virtualUrl)
Get properties of a file with a given virtual URL/storage path.
getLocalReference( $virtualUrl)
Get a local FS file with a given virtual URL/storage path.
getLocalCopy( $virtualUrl)
Get a local FS copy of a file with a given virtual URL/storage path.