*/
protected $settings;
-
/**
* List of detected DBs, access using getCompiledDBs().
*
'envCheckLibicu',
'envCheckSuhosinMaxValueLength',
'envCheckCtype',
+ 'envCheckJSON',
);
/**
'wgImageMagickConvertCommand',
'wgGitBin',
'IP',
- 'wgServer',
'wgScriptPath',
'wgScriptExtension',
'wgMetaNamespace',
/**
* URL to mediawiki-announce subscription
*/
- protected $mediaWikiAnnounceUrl = 'https://lists.wikimedia.org/mailman/subscribe/mediawiki-announce';
+ protected $mediaWikiAnnounceUrl =
+ 'https://lists.wikimedia.org/mailman/subscribe/mediawiki-announce';
/**
* Supported language codes for Mailman
if ( file_exists( "$IP/AdminSettings.php" ) ) {
require "$IP/AdminSettings.php";
}
+
return get_defined_vars();
}
'ss_users' => 0,
'ss_images' => 0 ),
__METHOD__, 'IGNORE' );
+
return Status::newGood();
}
$databases = $this->getCompiledDBs();
- $databases = array_flip ( $databases );
+ $databases = array_flip( $databases );
foreach ( array_keys( $databases ) as $db ) {
$installer = $this->getDBInstaller( $db );
$status = $installer->checkPrerequisites();
$databases = array_flip( $databases );
if ( !$databases ) {
$this->showError( 'config-no-db', $wgLang->commaList( $allNames ) );
+
// @todo FIXME: This only works for the web installer!
return false;
}
+
return true;
}
$test = new PhpXmlBugTester();
if ( !$test->ok ) {
$this->showError( 'config-brokenlibxml' );
+
return false;
}
+
return true;
}
$test->execute();
if ( !$test->ok ) {
$this->showError( 'config-using531', phpversion() );
+
return false;
}
+
return true;
}
protected function envCheckMagicQuotes() {
if ( wfIniGetBool( "magic_quotes_runtime" ) ) {
$this->showError( 'config-magic-quotes-runtime' );
+
return false;
}
+
return true;
}
protected function envCheckMagicSybase() {
if ( wfIniGetBool( 'magic_quotes_sybase' ) ) {
$this->showError( 'config-magic-quotes-sybase' );
+
return false;
}
+
return true;
}
protected function envCheckMbstring() {
if ( wfIniGetBool( 'mbstring.func_overload' ) ) {
$this->showError( 'config-mbstring' );
+
return false;
}
+
return true;
}
protected function envCheckZE1() {
if ( wfIniGetBool( 'zend.ze1_compatibility_mode' ) ) {
$this->showError( 'config-ze1' );
+
return false;
}
+
return true;
}
$this->setVar( '_SafeMode', true );
$this->showMessage( 'config-safe-mode' );
}
+
return true;
}
protected function envCheckXML() {
if ( !function_exists( "utf8_encode" ) ) {
$this->showError( 'config-xml-bad' );
+
return false;
}
+
return true;
}
protected function envCheckPCRE() {
if ( !function_exists( 'preg_match' ) ) {
$this->showError( 'config-pcre' );
+
return false;
}
wfSuppressWarnings();
wfRestoreWarnings();
if ( $regexd != '--' || $regexprop != '--' ) {
$this->showError( 'config-pcre-no-utf8' );
+
return false;
}
+
return true;
}
$this->setVar( '_RaiseMemory', true );
}
}
+
return true;
}
if ( self::apacheModulePresent( 'mod_security' ) ) {
$this->showMessage( 'config-mod-security' );
}
+
return true;
}
$this->setVar( 'wgDiff3', false );
$this->showMessage( 'config-diff3-bad' );
}
+
return true;
}
if ( $convert ) {
$this->setVar( 'wgImageMagickConvertCommand', $convert );
$this->showMessage( 'config-imagemagick', $convert );
+
return true;
} elseif ( function_exists( 'imagejpeg' ) ) {
$this->showMessage( 'config-gd' );
-
} else {
$this->showMessage( 'config-no-scaling' );
}
+
return true;
}
$this->setVar( 'wgGitBin', false );
$this->showMessage( 'config-git-bad' );
}
+
return true;
}
*/
protected function envCheckServer() {
$server = $this->envGetDefaultServer();
- $this->showMessage( 'config-using-server', $server );
- $this->setVar( 'wgServer', $server );
+ if ( $server !== null ) {
+ $this->showMessage( 'config-using-server', $server );
+ $this->setVar( 'wgServer', $server );
+ }
+
return true;
}
$IP = dirname( dirname( __DIR__ ) );
$this->setVar( 'IP', $IP );
- $this->showMessage( 'config-using-uri', $this->getVar( 'wgServer' ), $this->getVar( 'wgScriptPath' ) );
+ $this->showMessage(
+ 'config-using-uri',
+ $this->getVar( 'wgServer' ),
+ $this->getVar( 'wgScriptPath' )
+ );
+
return true;
}
$ext = 'php';
}
$this->setVar( 'wgScriptExtension', ".$ext" );
+
return true;
}
# Try the current value of LANG.
if ( isset( $candidatesByLocale[getenv( 'LANG' )] ) ) {
$this->setVar( 'wgShellLocale', getenv( 'LANG' ) );
+
return true;
}
foreach ( $commonLocales as $commonLocale ) {
if ( isset( $candidatesByLocale[$commonLocale] ) ) {
$this->setVar( 'wgShellLocale', $commonLocale );
+
return true;
}
}
if ( isset( $candidatesByLang[$wikiLang] ) ) {
$m = reset( $candidatesByLang[$wikiLang] );
$this->setVar( 'wgShellLocale', $m[0] );
+
return true;
}
if ( count( $candidatesByLocale ) ) {
$m = reset( $candidatesByLocale );
$this->setVar( 'wgShellLocale', $m[0] );
+
return true;
}
if ( !$safe ) {
$this->showMessage( 'config-uploads-not-safe', $dir );
}
+
return true;
}
// Only warn if the value is below the sane 1024
$this->showMessage( 'config-suhosin-max-value-length', $maxValueLength );
}
+
return true;
}
}
}
- // Uses messages 'config-unicode-using-php', 'config-unicode-using-utf8', 'config-unicode-using-intl'
+ // Uses messages 'config-unicode-using-php', 'config-unicode-using-utf8',
+ // 'config-unicode-using-intl'
if ( $useNormalizer === 'php' ) {
$this->showMessage( 'config-unicode-pure-php-warning' );
} else {
protected function envCheckCtype() {
if ( !function_exists( 'ctype_digit' ) ) {
$this->showError( 'config-ctype' );
+
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * @return bool
+ */
+ protected function envCheckJSON() {
+ if ( !function_exists( 'json_decode' ) ) {
+ $this->showError( 'config-json' );
+
return false;
}
+
return true;
}
* @param string $path path to search
* @param array $names of executable names
* @param $versionInfo Boolean false or array with two members:
- * 0 => Command to run for version check, with $1 for the full executable name
- * 1 => String to compare the output with
+ * 0 => Command to run for version check, with $1 for the full executable name
+ * 1 => String to compare the output with
*
* If $versionInfo is not false, only executables with a version
* matching $versionInfo[1] will be returned.
}
}
}
+
return false;
}
return $exe;
}
}
+
return false;
}
try {
$text = Http::get( $url . $file, array( 'timeout' => 3 ) );
- }
- catch ( MWException $e ) {
+ } catch ( MWException $e ) {
// Http::get throws with allow_url_fopen = false and no curl extension.
$text = null;
}
if ( $text == 'exec' ) {
wfRestoreWarnings();
+
return $ext;
}
}
ob_start();
phpinfo( INFO_MODULES );
$info = ob_get_clean();
+
return strpos( $info, $moduleName ) !== false;
}
*/
protected function getInstallSteps( DatabaseInstaller $installer ) {
$coreInstallSteps = array(
- array( 'name' => 'database', 'callback' => array( $installer, 'setupDatabase' ) ),
- array( 'name' => 'tables', 'callback' => array( $installer, 'createTables' ) ),
- array( 'name' => 'interwiki', 'callback' => array( $installer, 'populateInterwikiTable' ) ),
- array( 'name' => 'stats', 'callback' => array( $this, 'populateSiteStats' ) ),
- array( 'name' => 'keys', 'callback' => array( $this, 'generateKeys' ) ),
- array( 'name' => 'sysop', 'callback' => array( $this, 'createSysop' ) ),
- array( 'name' => 'mainpage', 'callback' => array( $this, 'createMainpage' ) ),
+ array( 'name' => 'database', 'callback' => array( $installer, 'setupDatabase' ) ),
+ array( 'name' => 'tables', 'callback' => array( $installer, 'createTables' ) ),
+ array( 'name' => 'interwiki', 'callback' => array( $installer, 'populateInterwikiTable' ) ),
+ array( 'name' => 'stats', 'callback' => array( $this, 'populateSiteStats' ) ),
+ array( 'name' => 'keys', 'callback' => array( $this, 'generateKeys' ) ),
+ array( 'name' => 'sysop', 'callback' => array( $this, 'createSysop' ) ),
+ array( 'name' => 'mainpage', 'callback' => array( $this, 'createMainpage' ) ),
);
// Build the array of install steps starting from the core install list,
'callback' => array( $installer, 'createExtensionTables' )
);
}
+
return $this->installSteps;
}
if ( $status->isOk() ) {
$this->setVar( '_InstallDone', true );
}
+
return $installResults;
}
if ( strval( $this->getVar( 'wgUpgradeKey' ) ) === '' ) {
$keys['wgUpgradeKey'] = 16;
}
+
return $this->doGenerateKeys( $keys );
}
);
$page->doEditContent( $content,
- '',
- EDIT_NEW,
- false,
- User::newFromName( 'MediaWiki default' ) );
+ '',
+ EDIT_NEW,
+ false,
+ User::newFromName( 'MediaWiki default' )
+ );
} catch ( MWException $e ) {
//using raw, because $wgShowExceptionDetails can not be set yet
$status->fatal( 'config-install-mainpage-failed', $e->getMessage() );
// Some of the environment checks make shell requests, remove limits
$GLOBALS['wgMaxShellMemory'] = 0;
+
+ // Don't bother embedding images into generated CSS, which is not cached
+ $GLOBALS['wgResourceLoaderLESSFunctions']['embeddable'] = function( $frame, $less ) {
+ return $less->toBool( false );
+ };
}
/**