111 return $this->storagePath;
122 if ( $this->path ===
false ) {
147 abstract public function toHtml( $options = [] );
171 return ( !$this->
isError() && ( $this->path || $this->path ===
null ) );
181 return ( !$this->
isError() && $this->path ===
null );
193 } elseif ( $this->path ===
null ) {
194 return $this->file->getLocalRefPath();
196 $be = $this->file->getRepo()->getBackend();
198 $fsFile = $be->getLocalReference( [
'src' => $this->path ] );
200 return $fsFile ? $fsFile->getPath() :
false;
214 if ( !$this->path ) {
215 return Status::newFatal(
'backend-fail-stream',
'<no path>' );
217 $be = $this->file->getRepo()->getBackend();
219 $be->streamFile( [
'src' => $this->path,
'headers' => $headers ] ) );
222 return $success ? Status::newGood() : Status::newFatal(
'backend-fail-stream', $this->path );
245 protected function linkWrap( $linkAttribs, $contents ) {
246 if ( isset( $linkAttribs[
'href'] ) ) {
247 return Xml::tags(
'a', $linkAttribs, $contents );
249 $parserEnableLegacyMediaDOM = MediaWikiServices::getInstance()
250 ->getMainConfig()->get( MainConfigNames::ParserEnableLegacyMediaDOM );
251 if ( $parserEnableLegacyMediaDOM ) {
254 return Xml::tags(
'span', $linkAttribs ?:
null, $contents );
265 if ( is_array( $params ) ) {
270 if ( $this->page && $this->page !== 1 ) {
271 $query[
'page'] = $this->page;
277 if ( is_string( $params ) && $params !==
'' ) {
282 'href' => $this->file->getTitle()->getLocalURL( $query ),
285 $parserEnableLegacyMediaDOM = MediaWikiServices::getInstance()
286 ->getMainConfig()->get( MainConfigNames::ParserEnableLegacyMediaDOM );
287 if ( $parserEnableLegacyMediaDOM ) {
288 $attribs[
'class'] =
'image';
290 $attribs[
'class'] =
'mw-file-description';
294 $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...
A class containing constants representing the names of configuration variables.
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