summaryrefslogtreecommitdiff
path: root/installer/helpers
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-01-18 18:13:54 +0000
committerTim Almdal <tnalmdal@shaw.ca>2009-01-18 18:13:54 +0000
commit72e7d50176a61eb5bb866ebe64607de6e23d21f2 (patch)
tree9764172de28115630ea6df7ca8277e4b6fb50f16 /installer/helpers
parentdd5be1ece03427f9ad7dada7891df8791ab7b2e1 (diff)
Remove the install.php file and move its contents into
installer::command_line method. Create an index.php that is can be used to install Gallery3 from the web or command line. At this point all that works is the command line installer and if the web installer tries to run, it is redirected to the album main page.
Diffstat (limited to 'installer/helpers')
-rw-r--r--installer/helpers/installer.php39
1 files changed, 39 insertions, 0 deletions
diff --git a/installer/helpers/installer.php b/installer/helpers/installer.php
index 6d866b90..871308d4 100644
--- a/installer/helpers/installer.php
+++ b/installer/helpers/installer.php
@@ -23,6 +23,45 @@ class installer {
private static $database = null;
private static $config_errors = false;
+ static function command_line() {
+ // remove the script name from the arguments
+ array_shift($_SERVER["argv"]);
+
+ //$_SERVER["HTTP_USER_AGENT"] = phpversion();
+ //date_default_timezone_set('America/Los_Angeles');
+
+ set_error_handler(create_function('$errno, $errstr, $errfile, $errline',
+ 'throw new ErrorException($errstr, 0, $errno, $errfile, $errline);'));
+
+ // Set exception handler
+ set_exception_handler(array("installer", "print_exception"));
+
+ // @todo Log the results of failed call
+ if (!installer::environment_check()) {
+ self::display_requirements();
+ die;
+ }
+
+ self::parse_cli_parms($_SERVER["argv"]);
+
+ $config_valid = true;
+
+ try {
+ $config_valid = self::check_database_authorization();
+ } catch (Exception $e) {
+ self::print_exception($e);
+ die("Specifed User does not have sufficient authority to install Gallery3\n");
+ }
+
+ $config_valid &= self::check_docroot_writable();
+
+ self::display_requirements(!$config_valid);
+
+ if ($config_valid) {
+ print self::install();
+ }
+ }
+
static function environment_check() {
$failed = false;
$section = array("header" => "Environment Test",