107 return $this->storagePath;
118 if ( $this->path ===
false ) {
143 abstract public function toHtml( $options = [] );
167 return ( !$this->
isError() && ( $this->path || $this->path ===
null ) );
177 return ( !$this->
isError() && $this->path ===
null );
189 } elseif ( $this->path ===
null ) {
190 return $this->file->getLocalRefPath();
192 $be = $this->file->getRepo()->getBackend();
194 $fsFile = $be->getLocalReference( [
'src' => $this->path ] );
196 return $fsFile ? $fsFile->getPath() :
false;
210 if ( !$this->path ) {
211 return Status::newFatal(
'backend-fail-stream',
'<no path>' );
213 $be = $this->file->getRepo()->getBackend();
215 $be->streamFile( [
'src' => $this->path,
'headers' => $headers ] ) );
218 return $success ? Status::newGood() : Status::newFatal(
'backend-fail-stream', $this->path );
240 protected function linkWrap( $linkAttribs, $contents ) {
241 if ( $linkAttribs ) {
242 return Xml::tags(
'a', $linkAttribs, $contents );
254 if ( is_array( $params ) ) {
259 if ( $this->page && $this->page !== 1 ) {
260 $query[
'page'] = $this->page;
266 if ( is_string( $params ) && $params !==
'' ) {
271 'href' => $this->file->getTitle()->getLocalURL( $query ),
275 $attribs[
'title'] =
$title;
wfArrayToCgi( $array1, $array2=null, $prefix='')
This function takes one or two arrays as input, and returns a CGI-style string, e....
static isStoragePath( $path)
Check if a given path is a "mwstore://" path.
static extensionFromPath( $path, $case='lowercase')
Get the final extension from a storage or FS path.
Implements some public methods and some protected utility functions which are required by multiple ch...
static stream( $fname, $headers=[], $sendErrors=true, $optHeaders=[], $flags=0)
Stream a file to the browser, adding all the headings and fun stuff.
if(PHP_SAPI !='cli-server') if(!isset( $_SERVER['SCRIPT_FILENAME'])) $file
Item class for a filearchive table row.
if(!isset( $args[0])) $lang