new-installer: Make findExtensions() return a key-value array
authorÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Tue, 6 Jul 2010 21:34:20 +0000 (21:34 +0000)
committerÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Tue, 6 Jul 2010 21:34:20 +0000 (21:34 +0000)
Now we return e.g.:

    array( 'Cite', 'LiquidThreads' );

Instead return:

    array(
        'Cite' => null,
        'LiquidThreads' => $some_config
    );

Where $some_config is a yet-to-be determined configuration. It's
intended for e.g. sourcing SQL tables that the extension needs.

includes/installer/Installer.php
includes/installer/WebInstaller.php

index 4124028..9ab53fa 100644 (file)
@@ -844,7 +844,7 @@ abstract class Installer {
                $dh = opendir( $dir );
                while ( ( $file = readdir( $dh ) ) !== false ) {
                        if( file_exists( "$dir/$file/$file.php" ) ) {
-                               $exts[] = $file;
+                               $exts[$file] = null;
                        }
                }
                $this->setVar( '_Extensions', $exts );
index c5bc3dd..ff6609a 100644 (file)
@@ -1387,7 +1387,7 @@ class WebInstaller_Options extends WebInstallerPage {
                $extensions = $this->parent->findExtensions();
                if( $extensions ) {
                        $extHtml = $this->parent->getFieldsetStart( 'config-extensions' );
-                       foreach( $extensions as $ext ) {
+                       foreach( array_keys($extensions) as $ext ) {
                                $extHtml .= $this->parent->getCheckBox( array(
                                        'var' => "ext-$ext",
                                        'rawtext' => $ext,