113 if ( $this->path ===
false ) {
138 abstract public function toHtml( $options = [] );
162 return ( !$this->
isError() && ( $this->path || $this->path ===
null ) );
172 return ( !$this->
isError() && $this->path ===
null );
186 if ( $this->path ===
null ) {
188 return $this->file->getLocalRefPath();
191 $be = $this->file->getRepo()->getBackend();
193 $fsFile = $be->getLocalReference( [
'src' => $this->path ] );
195 return $fsFile ? $fsFile->getPath() :
false;
209 if ( !$this->path ) {
210 return Status::newFatal(
'backend-fail-stream',
'<no path>' );
213 $repo = $this->file->getRepo();
217 $repo->getBackend()->streamFile(
218 [
'src' => $this->path,
'headers' => $headers, ]
225 $repo ? $repo->getBackend()->getStreamerOptions() : []
231 : Status::newFatal(
'backend-fail-stream', $this->path );
253 protected function linkWrap( $linkAttribs, $contents ) {
254 if ( isset( $linkAttribs[
'href'] ) ) {
255 return Html::rawElement(
'a', $linkAttribs, $contents );
257 return Html::rawElement(
'span', $linkAttribs ?: [], $contents );
266 if ( is_array( $params ) ) {
271 if ( $this->page && $this->page !== 1 ) {
278 if ( is_string( $params ) && $params !==
'' ) {
283 'href' => $this->file->getTitle()->getLocalURL( $query ),
284 'class' =>
'mw-file-description',
288 $attribs[
'title'] = $title;
296class_alias( MediaTransformOutput::class,
'MediaTransformOutput' );
wfArrayToCgi( $array1, $array2=null, $prefix='')
This function takes one or two arrays as input, and returns a CGI-style string, e....