From 681197a265f1dd3873780fdcf0b5f1e8fa0150ab Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 20 Jan 2009 00:54:02 +0000 Subject: Web based installer. It's still got some rough edges, but you can now do a complete CLI or web based install. --- installer/cli.php | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 installer/cli.php (limited to 'installer/cli.php') diff --git a/installer/cli.php b/installer/cli.php new file mode 100644 index 00000000..bff9c16c --- /dev/null +++ b/installer/cli.php @@ -0,0 +1,90 @@ + " . $message; + print "\n"; + print "For help you can try:\n"; + print " * The Gallery3 FAQ - http://codex.gallery2.org/Gallery3:FAQ\n"; + print " * The Gallery Forums - http://gallery.menalto.com/forum\n"; + print "\n\n** INSTALLATION FAILED **\n"; + exit(1); +} + +function parse_cli_params() { + $config = array("host" => "localhost", + "user" => "root", + "password" => "", + "dbname" => "gallery3", + "prefix" => "", + "type" => function_exists("mysqli_init") ? "mysqli" : "mysql"); + + $argv = $_SERVER["argv"]; + for ($i = 1; $i < count($argv); $i++) { + switch (strtolower($argv[$i])) { + case "-d": + $config["dbname"] = $argv[++$i]; + break; + case "-h": + $config["host"] = $argv[++$i]; + break; + case "-u": + $config["user"] = $argv[++$i]; + break; + case "-p": + $config["password"] = $argv[++$i]; + break; + } + } + + return $config; +} -- cgit v1.2.3