}
public function showMessage( $msg /*, ... */ ) {
- $params = func_get_args();
- array_shift( $params );
+ echo $this->getMessageText( func_get_args() ) . "\n";
+ flush();
+ }
+
+ public function showError( $msg /*, ... */ ) {
+ echo "***{$this->getMessageText( func_get_args() )}***\n";
+ flush();
+ }
+
+ /**
+ * @return string
+ */
+ protected function getMessageText( $params ) {
+ $msg = array_shift( $params );
$text = wfMsgExt( $msg, array( 'parseinline' ), $params );
$text = preg_replace( '/<a href="(.*?)".*?>(.*?)<\/a>/', '$2 <$1>', $text );
- echo html_entity_decode( strip_tags( $text ), ENT_QUOTES ) . "\n";
- flush();
+ return html_entity_decode( strip_tags( $text ), ENT_QUOTES );
+ }
+
+ /**
+ * Dummy
+ */
+ public function showHelpBox( $msg /*, ... */ ) {
}
public function showStatusMessage( Status $status ) {
*/
public abstract function showMessage( $msg /*, ... */ );
+ /**
+ * Same as showMessage(), but for displaying errors
+ */
+ public abstract function showError( $msg /*, ... */ );
+
/**
* Show a message to the installing user by using a Status object
* @param $status Status
$this->setVar( '_CompiledDBs', $compiledDBs );
if ( !$compiledDBs ) {
- $this->showMessage( 'config-no-db' );
+ $this->showError( 'config-no-db' );
// FIXME: this only works for the web installer!
$this->showHelpBox( 'config-no-db-help', $wgLang->commaList( $allNames ) );
return false;
protected function envCheckBrokenXML() {
$test = new PhpXmlBugTester();
if ( !$test->ok ) {
- $this->showMessage( 'config-brokenlibxml' );
+ $this->showError( 'config-brokenlibxml' );
return false;
}
}
$test = new PhpRefCallBugTester;
$test->execute();
if ( !$test->ok ) {
- $this->showMessage( 'config-using531', phpversion() );
+ $this->showError( 'config-using531', phpversion() );
return false;
}
}
*/
protected function envCheckMagicQuotes() {
if( wfIniGetBool( "magic_quotes_runtime" ) ) {
- $this->showMessage( 'config-magic-quotes-runtime' );
+ $this->showError( 'config-magic-quotes-runtime' );
return false;
}
}
*/
protected function envCheckMagicSybase() {
if ( wfIniGetBool( 'magic_quotes_sybase' ) ) {
- $this->showMessage( 'config-magic-quotes-sybase' );
+ $this->showError( 'config-magic-quotes-sybase' );
return false;
}
}
*/
protected function envCheckMbstring() {
if ( wfIniGetBool( 'mbstring.func_overload' ) ) {
- $this->showMessage( 'config-mbstring' );
+ $this->showError( 'config-mbstring' );
return false;
}
}
*/
protected function envCheckZE1() {
if ( wfIniGetBool( 'zend.ze1_compatibility_mode' ) ) {
- $this->showMessage( 'config-ze1' );
+ $this->showError( 'config-ze1' );
return false;
}
}
*/
protected function envCheckXML() {
if ( !function_exists( "utf8_encode" ) ) {
- $this->showMessage( 'config-xml-bad' );
+ $this->showError( 'config-xml-bad' );
return false;
}
}
*/
protected function envCheckPCRE() {
if ( !function_exists( 'preg_match' ) ) {
- $this->showMessage( 'config-pcre' );
+ $this->showError( 'config-pcre' );
return false;
}
wfSuppressWarnings();
$regexd = preg_replace( '/[\x{0430}-\x{04FF}]/iu', '', '-АБВГД-' );
wfRestoreWarnings();
if ( $regexd != '--' ) {
- $this->showMessage( 'config-pcre-no-utf8' );
+ $this->showError( 'config-pcre-no-utf8' );
return false;
}
}
// Some kind soul has set it for us already (e.g. debconf)
return true;
} else {
- $this->showMessage( 'config-no-uri' );
+ $this->showError( 'config-no-uri' );
return false;
}