MediaWiki master
MediaTransformError.php
Go to the documentation of this file.
1<?php
27
37 private $msg;
38
47 public function __construct( $msg, $width, $height, ...$args ) {
48 $this->msg = wfMessage( $msg )->params( $args );
49 $this->width = (int)$width;
50 $this->height = (int)$height;
51 $this->url = false;
52 $this->path = false;
53 }
54
55 public function toHtml( $options = [] ) {
56 return "<div class=\"MediaTransformError\" style=\"" .
57 "width: {$this->width}px; height: {$this->height}px; display:inline-block;\">" .
58 $this->getHtmlMsg() .
59 "</div>";
60 }
61
62 public function toText() {
63 return $this->msg->text();
64 }
65
66 public function getHtmlMsg() {
67 return $this->msg->escaped();
68 }
69
70 public function getMsg() {
71 return $this->msg;
72 }
73
74 public function isError() {
75 return true;
76 }
77
83 public function getHttpStatusCode() {
84 return 500;
85 }
86}
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
Basic media transform error class.
__construct( $msg, $width, $height,... $args)
toHtml( $options=[])
Fetch HTML for this transform output.
isError()
This will be overridden to return true in error classes.
Base class for the output of MediaHandler::doTransform() and File::transform().
The Message class deals with fetching and processing of interface message into a variety of formats.
Definition Message.php:155
Value object representing a message parameter that consists of a list of values.