109 if ( $this->path ===
false ) {
134 abstract public function toHtml( $options = [] );
158 return ( !$this->
isError() && ( $this->path || $this->path ===
null ) );
168 return ( !$this->
isError() && $this->path ===
null );
180 } elseif ( $this->path ===
null ) {
181 return $this->file->getLocalRefPath();
183 $be = $this->file->getRepo()->getBackend();
185 $fsFile = $be->getLocalReference( [
'src' => $this->path ] );
187 return $fsFile ? $fsFile->getPath() :
false;
201 if ( !$this->path ) {
202 return Status::newFatal(
'backend-fail-stream',
'<no path>' );
204 $be = $this->file->getRepo()->getBackend();
206 $be->streamFile( [
'src' => $this->path,
'headers' => $headers ] ) );
209 return $success ? Status::newGood() : Status::newFatal(
'backend-fail-stream', $this->path );
231 protected function linkWrap( $linkAttribs, $contents ) {
232 if ( $linkAttribs ) {
233 return Xml::tags(
'a', $linkAttribs, $contents );
245 if ( is_array( $params ) ) {
250 if ( $this->page && $this->page !== 1 ) {
257 if ( is_string( $params ) && $params !==
'' ) {
262 'href' => $this->file->getTitle()->getLocalURL( $query ),
266 $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.