'envCheckModSecurity',
'envCheckDiff3',
'envCheckGraphics',
+ 'envCheckGit',
'envCheckServer',
'envCheckPath',
'envCheckExtension',
'wgDBtype',
'wgDiff3',
'wgImageMagickConvertCommand',
+ 'wgGitBin',
'IP',
'wgServer',
'wgScriptPath',
$type = strtolower( $type );
if ( !isset( $this->dbInstallers[$type] ) ) {
- $class = ucfirst( $type ). 'Installer';
+ $class = ucfirst( $type ) . 'Installer';
$this->dbInstallers[$type] = new $class( $this );
}
$allNames = array();
+ // Give grep a chance to find the usages:
+ // config-type-mysql, config-type-postgres, config-type-oracle, config-type-sqlite
foreach ( self::getDBTypes() as $name ) {
$allNames[] = wfMessage( "config-type-$name" )->text();
}
*/
protected function envCheckGraphics() {
$names = array( wfIsWindows() ? 'convert.exe' : 'convert' );
- $convert = self::locateExecutableInDefaultPaths( $names, array( '$1 -version', 'ImageMagick' ) );
+ $versionInfo = array( '$1 -version', 'ImageMagick' );
+ $convert = self::locateExecutableInDefaultPaths( $names, $versionInfo );
$this->setVar( 'wgImageMagickConvertCommand', '' );
if ( $convert ) {
return true;
}
+ /**
+ * Search for git.
+ *
+ * @since 1.22
+ * @return bool
+ */
+ protected function envCheckGit() {
+ $names = array( wfIsWindows() ? 'git.exe' : 'git' );
+ $versionInfo = array( '$1 --version', 'git version' );
+
+ $git = self::locateExecutableInDefaultPaths( $names, $versionInfo );
+
+ if ( $git ) {
+ $this->setVar( 'wgGitBin', $git );
+ $this->showMessage( 'config-git', $git );
+ } else {
+ $this->setVar( 'wgGitBin', false );
+ $this->showMessage( 'config-git-bad' );
+ }
+ return true;
+ }
+
/**
* Environment check for the server hostname.
*/
}
# Try the current value of LANG.
- if ( isset( $candidatesByLocale[ getenv( 'LANG' ) ] ) ) {
+ if ( isset( $candidatesByLocale[getenv( 'LANG' )] ) ) {
$this->setVar( 'wgShellLocale', getenv( 'LANG' ) );
return true;
}
*/
public function findExtensions() {
if( $this->getVar( 'IP' ) === null ) {
- return false;
+ return array();
}
- $exts = array();
$extDir = $this->getVar( 'IP' ) . '/extensions';
- $dh = opendir( $extDir );
+ if ( !is_readable( $extDir ) || !is_dir( $extDir ) ) {
+ return array();
+ }
+ $dh = opendir( $extDir );
+ $exts = array();
while ( ( $file = readdir( $dh ) ) !== false ) {
if( !is_dir( "$extDir/$file" ) ) {
continue;
$exts[] = $file;
}
}
+ closedir( $dh );
natcasesort( $exts );
return $exts;
// then adding any callbacks that wanted to attach after a given step
foreach( $coreInstallSteps as $step ) {
$this->installSteps[] = $step;
- if( isset( $this->extraInstallSteps[ $step['name'] ] ) ) {
+ if( isset( $this->extraInstallSteps[$step['name']] ) ) {
$this->installSteps = array_merge(
$this->installSteps,
- $this->extraInstallSteps[ $step['name'] ]
+ $this->extraInstallSteps[$step['name']]
);
}
}
$status = Status::newGood();
try {
$page = WikiPage::factory( Title::newMainPage() );
- $content = new WikitextContent (
+ $content = new WikitextContent(
wfMessage( 'mainpagetext' )->inContentLanguage()->text() . "\n\n" .
wfMessage( 'mainpagedocfooter' )->inContentLanguage()->text()
);
EDIT_NEW,
false,
User::newFromName( 'MediaWiki default' ) );
- } catch (MWException $e) {
+ } catch ( MWException $e ) {
//using raw, because $wgShowExceptionDetails can not be set yet
$status->fatal( 'config-install-mainpage-failed', $e->getMessage() );
}