- $wgParser->setHook( 'downloadlink', array( $this, 'downloadLinkHook' ) );
- $wgParser->setHook( 'doclink', array( $this, 'docLink' ) );
+ $wgParser->setHook( 'downloadlink', [ $this, 'downloadLinkHook' ] );
+ $wgParser->setHook( 'doclink', [ $this, 'docLink' ] );
'local path' => dirname( __DIR__ ),
'url' => $url,
'version' => $GLOBALS['wgVersion']
'local path' => dirname( __DIR__ ),
'url' => $url,
'version' => $GLOBALS['wgVersion']
- * Show an error message in a box. Parameters are like wfMessage().
- * @param string $msg
+ * Show an error message in a box. Parameters are like wfMessage(), or
+ * alternatively, pass a Message object in.
+ * @param string|Message $msg
- $args = func_get_args();
- array_shift( $args );
- $args = array_map( 'htmlspecialchars', $args );
- $msg = wfMessage( $msg, $args )->useDatabase( false )->plain();
- $this->output->addHTML( $this->getErrorBox( $msg ) );
+ if ( !( $msg instanceof Message ) ) {
+ $args = func_get_args();
+ array_shift( $args );
+ $args = array_map( 'htmlspecialchars', $args );
+ $msg = wfMessage( $msg, $args );
+ }
+ $text = $msg->useDatabase( false )->plain();
+ $this->output->addHTML( $this->getErrorBox( $text ) );
* We're restarting the installation, reset the session, happyPages, etc
*/
public function reset() {
* We're restarting the installation, reset the session, happyPages, etc
*/
public function reset() {
$url = $this->request->getRequestURL();
# Remove existing query
$url = preg_replace( '/\?.*$/', '', $url );
$url = $this->request->getRequestURL();
# Remove existing query
$url = preg_replace( '/\?.*$/', '', $url );
if ( $this->getSession( 'test' ) === null && !$this->request->wasPosted() ) {
$wgLanguageCode = $this->getAcceptLanguage();
$wgLang = $wgContLang = Language::factory( $wgLanguageCode );
if ( $this->getSession( 'test' ) === null && !$this->request->wasPosted() ) {
$wgLanguageCode = $this->getAcceptLanguage();
$wgLang = $wgContLang = Language::factory( $wgLanguageCode );
$this->setVar( 'wgLanguageCode', $wgLanguageCode );
$this->setVar( '_UserLang', $wgLanguageCode );
} else {
$this->setVar( 'wgLanguageCode', $wgLanguageCode );
$this->setVar( '_UserLang', $wgLanguageCode );
} else {
// config-page-dbsettings, config-page-name, config-page-options, config-page-install,
// config-page-complete, config-page-restart, config-page-readme, config-page-releasenotes,
// config-page-copying, config-page-upgradedoc, config-page-existingwiki
// config-page-dbsettings, config-page-name, config-page-options, config-page-install,
// config-page-complete, config-page-restart, config-page-readme, config-page-releasenotes,
// config-page-copying, config-page-upgradedoc, config-page-existingwiki
wfMessage( 'config-page-' . strtolower( $currentPageName ) )->text() );
$this->output->addHTMLNoFlush( $s );
wfMessage( 'config-page-' . strtolower( $currentPageName ) )->text() );
$this->output->addHTMLNoFlush( $s );
if ( !in_array( $pageName, $this->pageSequence ) ) {
if ( in_array( $currentPageName, $this->pageSequence ) ) {
if ( !in_array( $pageName, $this->pageSequence ) ) {
if ( in_array( $currentPageName, $this->pageSequence ) ) {
public function showStatusMessage( Status $status ) {
$errors = array_merge( $status->getErrorsArray(), $status->getWarningsArray() );
foreach ( $errors as $error ) {
public function showStatusMessage( Status $status ) {
$errors = array_merge( $status->getErrorsArray(), $status->getWarningsArray() );
foreach ( $errors as $error ) {
'id' => $params['controlName'],
'class' => 'config-input-text',
'tabindex' => $this->nextTabIndex()
'id' => $params['controlName'],
'class' => 'config-input-text',
'tabindex' => $this->nextTabIndex()
'id' => $params['controlName'],
'class' => 'config-input-text',
'tabindex' => $this->nextTabIndex()
'id' => $params['controlName'],
'class' => 'config-input-text',
'tabindex' => $this->nextTabIndex()
'id' => $params['controlName'],
'tabindex' => $this->nextTabIndex(),
'id' => $params['controlName'],
'tabindex' => $this->nextTabIndex(),
$items[$value] =
Xml::radio( $params['controlName'], $value, $checked, $itemAttribs ) .
' ' .
$items[$value] =
Xml::radio( $params['controlName'], $value, $checked, $itemAttribs ) .
' ' .
isset( $params['itemLabels'] ) ?
wfMessage( $params['itemLabels'][$value] )->plain() :
wfMessage( $params['itemLabelPrefix'] . strtolower( $value ) )->plain()
isset( $params['itemLabels'] ) ?
wfMessage( $params['itemLabels'][$value] )->plain() :
wfMessage( $params['itemLabelPrefix'] . strtolower( $value ) )->plain()
*/
public function downloadLinkHook( $text, $attribs, $parser ) {
$anchor = Html::rawElement( 'a',
*/
public function downloadLinkHook( $text, $attribs, $parser ) {
$anchor = Html::rawElement( 'a',