summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-01-11 07:14:19 +0000
committerTim Almdal <tnalmdal@shaw.ca>2009-01-11 07:14:19 +0000
commit6fdca531c646e8f6d9798b96464da30c92276be8 (patch)
treebb3ab7ee91815e45c324a465a60ee3c26ae30d86
parent3df78891287bd4cd5e142c51665c4494c743db11 (diff)
allow modules to be installed to be specified as command line option or in the response file
-rw-r--r--installer/helpers/installer.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/installer/helpers/installer.php b/installer/helpers/installer.php
index 4ab1d94e..f4ce5057 100644
--- a/installer/helpers/installer.php
+++ b/installer/helpers/installer.php
@@ -189,21 +189,46 @@ class installer {
case "-f":
$arguments["file"] = $argv[++$i];
break;
+ case "-m":
+ $arguments["modules"] = $argv[++$i];
+ break;
}
}
$config = array("host" => "localhost", "user" => "root", "password" => "",
+ "modules" => array("core" => 1, "user" => 1),
"dbname" => "gallery3", "prefix" => "");
if (!empty($arguments["file"])) {
if (file_exists($arguments["file"])) {
+ $save_modules = $config["modules"];
include $arguments["file"];
+ if (!is_array($config["modules"])) {
+ $modules = explode(",", $config["modules"]);
+ $config["modules"] = array_merge($save_modules, array_fill_keys($modules, 1));
+ }
}
unset($arguments["file"]);
}
+
+ if (!empty($arguments["modules"])) {
+ $modules = explode(",", $arguments["modules"]);
+
+ $config["modules"] = array_merge($config["modules"], array_fill_keys($modules, 1));
+ unset($arguments["modules"]);
+ }
+
+ foreach (array_keys($config["modules"]) as $module) {
+ unset($config["modules"][$module]);
+ $config["modules"][trim($module)] = 1;
+ }
+
self::$config = array_merge($config, $arguments);
foreach (self::$config as $key => $value) {
+ if ($key == "modules") {
+ $value = implode(", ", array_keys($value));
+ }
$section["msgs"][$key] = array("text" => $value, "error" => false);
}
self::$messages[] = $section;