summaryrefslogtreecommitdiff
path: root/installer/installer.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/installer.php
parent0e3df4e5d2d3d07199f5465fd6d21b45c96f844b (diff)
Get rid of InstallException and handle exceptions from create_admin()
properly.
Diffstat (limited to 'installer/installer.php')
-rw-r--r--installer/installer.php23
1 files changed, 1 insertions, 22 deletions
diff --git a/installer/installer.php b/installer/installer.php
index cd410571..62523308 100644
--- a/installer/installer.php
+++ b/installer/installer.php
@@ -34,22 +34,6 @@ class installer {
return false;
}
- static function setup_var() {
- $errors = array();
- if (is_writable(VARPATH)) {
- return;
- }
-
- if (is_writable(dirname(VARPATH)) && !mkdir(VARPATH)) {
- $errors["Filesystem"] =
- sprintf("The %s directory doesn't exist and can't be created", VARPATH);
- }
-
- if ($errors) {
- throw new InstallException($errors);
- }
- }
-
static function create_database_config($config) {
$db_config_file = VARPATH . "database.php";
ob_start();
@@ -95,7 +79,6 @@ class installer {
}
static function create_admin($config) {
- $errors = array();
$salt = "";
for ($i = 0; $i < 4; $i++) {
$char = mt_rand(48, 109);
@@ -106,11 +89,7 @@ class installer {
$hashed_password = $salt . md5($salt . $password);
if (mysql_query("UPDATE `users` SET `password` = '$hashed_password' WHERE `id` = 2")) {
} else {
- $errors["Database"] = "Unable to set admin password. Error details:\n" . mysql_error();
- }
-
- if ($errors) {
- throw new InstallException($errors);
+ throw new Exception(mysql_error());
}
return array("admin", $password);