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"]); header("Location: $redirect"); return; } if (file_exists('var')) { dir("Gallery3 is already installed... exiting"); } array_shift($argv); // remove the script name from the arguments define("DOCROOT", dirname(dirname(__FILE__))); chdir(DOCROOT); define('APPPATH', strtr(realpath('core') . '/', DIRECTORY_SEPARATOR, '/')); define('MODPATH', strtr(realpath('modules') . '/', DIRECTORY_SEPARATOR, '/')); 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 if (!installer::environment_check()) { installer::display_requirements(); die; } installer::parse_cli_parms($argv); $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"); } $config_valid = installer::check_docroot_writable(); installer::display_requirements(!$config_valid); if ($config_valid) { // @todo do the install }