summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2008-11-05 22:29:42 +0000
committerBharat Mediratta <bharat@menalto.com>2008-11-05 22:29:42 +0000
commit91a0236f8cdea57f70433f0f90a4f60f9418cbad (patch)
tree169abe7fd1267f247096b6b77a71f86fb1a54ba3
parent3d20abcdf0874e831f64811a81f10b5610e8cda3 (diff)
Guard the module loading code against database errors (in case the database isn't configured yet)
-rw-r--r--core/controllers/welcome.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/controllers/welcome.php b/core/controllers/welcome.php
index 4a3dacb4..f68813c3 100644
--- a/core/controllers/welcome.php
+++ b/core/controllers/welcome.php
@@ -23,14 +23,17 @@ class Welcome_Controller extends Template_Controller {
function index() {
$this->template->syscheck = new View("welcome_syscheck.html");
$this->template->syscheck->errors = $this->_get_config_errors();
- $this->template->syscheck->modules = $this->_read_modules();
+ $this->templlate->syscheck->modules = array();
$this->template->album_count = 0;
$this->template->photo_count = 0;
try {
+ $old_handler = set_error_handler(array("Welcome_Controller", "_error_handler"));
+ $this->template->syscheck->modules = $this->_read_modules();
$this->template->album_count = ORM::factory("item")->where("type", "album")->count_all();
$this->template->photo_count = ORM::factory("item")->where("type", "photo")->count_all();
} catch (Exception $e) {
}
+ set_error_handler($old_handler);
$this->_create_directories();
}
@@ -119,7 +122,7 @@ class Welcome_Controller extends Template_Controller {
if (!file_exists($db_php)) {
$error = new stdClass();
$error->message = "Missing: $db_php";
- $error->instructions[] = "cp kohana/config/database.php $db_php";
+ $error->instructions[] = "cp " . DOCROOT . "kohana/config/database.php $db_php";
$error->instructions[] = "chmod 644 $db_php";
$error->message2 = "Then edit this file and enter your database configuration settings.";
$errors[] = $error;