From 6c59a196772b6d6c6b2b969b85c1a2551ef017d8 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 15 Feb 2009 09:14:03 +0000 Subject: Get rid of InstallException and handle exceptions from create_admin() properly. --- installer/cli.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'installer/cli.php') 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) { -- cgit v1.2.3