diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-01-11 23:08:23 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-01-11 23:08:23 +0000 |
commit | 65e28bc678b1d9fc0b6af4cb848cfde338b2f01c (patch) | |
tree | afef4d0130611a47eb396b8d30f01819e3f1685b /installer/install.php | |
parent | 70b96082751b381ce31d858f9806dda2e63a9588 (diff) |
Moving slowly forward on the batch installer. It now connects to the database and checks that the supplied database is defined.
Diffstat (limited to 'installer/install.php')
-rw-r--r-- | installer/install.php | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/installer/install.php b/installer/install.php index 7abea163..2a140594 100644 --- a/installer/install.php +++ b/installer/install.php @@ -35,6 +35,19 @@ * on the command line will override values contained in this file */ +function exception_handler($exception) { + $code = $exception->getCode(); + $type = get_class($exception); + $message = $exception->getMessage(); + $file = $exception->getFile(); + $line = $exception->getLine(); + + var_dump($exception); + // Turn off error reporting + error_reporting(0); + exit; +} + if (PHP_SAPI != 'cli') { $redirect = str_replace("install.php", "index.php", $_SERVER["REQUEST_URI"]); @@ -56,6 +69,12 @@ define('THEMEPATH', strtr(realpath('themes') . '/', DIRECTORY_SEPARATOR, '/')); define('SYSPATH', strtr(realpath('kohana') . '/', DIRECTORY_SEPARATOR, '/')); define('EXT', ".php"); +//set_error_handler(array('Kohana', 'exception_handler')); +set_error_handler(create_function('$x, $y', 'throw new Exception($y, $x);')); + +// Set exception handler +set_exception_handler('exception_handler'); + include DOCROOT . "/installer/helpers/installer.php"; // @todo Log the results of failed call @@ -66,6 +85,19 @@ if (!installer::environment_check()) { installer::parse_cli_parms($argv); -installer::display_requirements(); +$config_valid = true; + +try { + $config_valid = installer::check_database_authorization(); +} catch (Exception $e) { + die("Specifed User does not have sufficient authority to install Gallery3\n"); +} +var_dump($config_valid); + +installer::display_requirements(!$config_valid); + +if ($config_valid) { + // @todo do the install +} |