MediaWiki REL1_30
FakeDimensionFile.php
Go to the documentation of this file.
1<?php
2
6class FakeDimensionFile extends File {
7 public $mustRender = false;
8 public $mime;
9 public $dimensions;
10
11 public function __construct( $dimensions, $mime = 'unknown/unknown' ) {
12 parent::__construct( Title::makeTitle( NS_FILE, 'Test' ),
13 new NullRepo( null ) );
14
15 $this->dimensions = $dimensions;
16 $this->mime = $mime;
17 }
18
19 public function getWidth( $page = 1 ) {
20 return $this->dimensions[0];
21 }
22
23 public function getHeight( $page = 1 ) {
24 return $this->dimensions[1];
25 }
26
27 public function mustRender() {
28 return $this->mustRender;
29 }
30
31 public function getPath() {
32 return '';
33 }
34
35 public function getMimeType() {
36 return $this->mime;
37 }
38}
mustRender()
Return true if the file is of a type that can't be directly rendered by typical browsers and needs to...
getMimeType()
Returns the MIME type of the file.
getWidth( $page=1)
Return the width of the image.
__construct( $dimensions, $mime='unknown/unknown')
Call this constructor from child classes.
getPath()
Return the storage path to the file.
getHeight( $page=1)
Return the height of the image.
Implements some public methods and some protected utility functions which are required by multiple ch...
Definition File.php:51
File repository with no files, for performance testing.
Definition NullRepo.php:28
const NS_FILE
Definition Defines.php:71