summaryrefslogtreecommitdiff
path: root/installer/cli.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-02-15 09:14:03 +0000
committerBharat Mediratta <bharat@menalto.com>2009-02-15 09:14:03 +0000
commit6c59a196772b6d6c6b2b969b85c1a2551ef017d8 (patch)
treef5fa4ee8694a290b0e46245ba2d376e4723012c0 /installer/cli.php
parent0e3df4e5d2d3d07199f5465fd6d21b45c96f844b (diff)
Get rid of InstallException and handle exceptions from create_admin()
properly.
Diffstat (limited to 'installer/cli.php')
-rw-r--r--installer/cli.php18
1 files changed, 11 insertions, 7 deletions
diff --git a/installer/cli.php b/installer/cli.php
index 93d4d502..fb497635 100644
--- a/installer/cli.php
+++ b/installer/cli.php
@@ -46,13 +46,17 @@ if (!installer::connect($config)) {
oops("Couldn't create var/database.php");
} else {
system("chmod -R 777 " . VARPATH);
- list ($user, $password) = installer::create_admin($config);
- print "Your Gallery has been successfully installed!\n";
- print "We've created an account for you to use:\n";
- print " username: $user\n";
- print " password: $password\n";
- print "\n";
- exit(0);
+ try {
+ list ($user, $password) = installer::create_admin($config);
+ print "Your Gallery has been successfully installed!\n";
+ print "We've created an account for you to use:\n";
+ print " username: $user\n";
+ print " password: $password\n";
+ print "\n";
+ exit(0);
+ } catch (Exception $e) {
+ oops($e->getMessage());
+ }
}
function oops($message) {