18 private $extName =
'unknown';
29 $this->isSkin = substr(
$path, -10 ) ===
"/skin.json";
31 preg_match(
"!/([^/]*)/[^/]*.json$!",
$path, $m );
33 $this->extName = $m[1];
36 $this->error = $error;
38 parent::__construct(
"Error Loading extension. Unable to open file $path: $error" );
48 private function renderHtml() {
49 if ( !headers_sent() ) {
50 HttpStatus::header( 500 );
51 header(
'Content-Type: text/html; charset=UTF-8' );
58 'ExtensionConfigError',
61 'path' => $this->path,
62 'type' => $this->isSkin ?
'skin' :
'extension',
63 'error' => $this->error,
64 'extName' => $this->extName,
65 'trace' => $this->getTraceAsString(),
66 'mwLogo' => $this->getMWLogo(),
69 }
catch ( Exception $e ) {
70 echo
'Error: ' . htmlspecialchars( $e->getMessage() );
77 private function renderText() {
78 $type = $this->isSkin ?
'skin' :
'extension';
79 echo
"Error: The $this->extName $type cannot be loaded. "
80 .
"Check that all of its files are installed properly.\n\n";
81 echo $this->getTraceAsString();
98 trigger_error( $this->getMessage(), E_USER_ERROR );
106 private function getMWLogo() {
108 $suffix =
"/resources/assets/mediawiki.png";
114 foreach ( array_filter( explode(
'/', $_SERVER[
'PHP_SELF'] ) ) as $part ) {
115 if ( !preg_match(
'/\.php$/', $part ) ) {
122 return $path . $suffix;
const MW_VERSION
The running version of MediaWiki.
A BagOStuff object with no objects in it.
__construct( $path, $error)
render()
Output an error response and exit.
$wgResourceBasePath
Config variable stub for the ResourceBasePath setting, for use by phpdoc and IDEs.