93 if ( $this->url ===
false ) {
97 return $this->
getFile()->appendRequestProvenance( $this->url, [
98 'format' =>
'thumbnail',
119 if ( $this->path ===
false ) {
144 abstract public function toHtml( $options = [] );
168 return ( !$this->
isError() && ( $this->path || $this->path ===
null ) );
178 return ( !$this->
isError() && $this->path ===
null );
192 if ( $this->path ===
null ) {
194 return $this->file->getLocalRefPath();
197 $be = $this->file->getRepo()->getBackend();
199 $fsFile = $be->getLocalReference( [
'src' => $this->path ] );
201 return $fsFile ? $fsFile->getPath() :
false;
215 if ( !$this->path ) {
216 return Status::newFatal(
'backend-fail-stream',
'<no path>' );
219 $repo = $this->file->getRepo();
223 $repo->getBackend()->streamFile(
224 [
'src' => $this->path,
'headers' => $headers, ]
231 $repo ? $repo->getBackend()->getStreamerOptions() : []
237 : Status::newFatal(
'backend-fail-stream', $this->path );
259 protected function linkWrap( $linkAttribs, $contents ) {
260 if ( isset( $linkAttribs[
'href'] ) ) {
261 return Html::rawElement(
'a', $linkAttribs, $contents );
263 return Html::rawElement(
'span', $linkAttribs ?: [], $contents );
272 if ( is_array( $params ) ) {
277 if ( $this->page && $this->page !== 1 ) {
284 if ( is_string( $params ) && $params !==
'' ) {
289 'href' => $this->file->getTitle()->getLocalURL( $query ),
290 'class' =>
'mw-file-description',
294 $attribs[
'title'] = $title;
302class_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....