From 25b9a20b76b5f11d48d97fa586c6eba9adfd9019 Mon Sep 17 00:00:00 2001 From: cajus Date: Wed, 16 Jan 2008 16:25:02 +0000 Subject: [PATCH] Added useful error messages git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8404 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/html/main.php | 7 ++++++- gosa-core/include/functions.inc | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gosa-core/html/main.php b/gosa-core/html/main.php index be0b72869..dcdd935ad 100644 --- a/gosa-core/html/main.php +++ b/gosa-core/html/main.php @@ -142,7 +142,12 @@ if (!session::is_set('plist')){ $class_list= get_declared_classes(); foreach ($class_mapping as $class => $path){ if (!in_array($class, $class_list)){ - require_once("$BASE_DIR/$path"); + if (is_readable("$BASE_DIR/$path")){ + require_once("$BASE_DIR/$path"); + } else { + echo sprintf(_("Fatal error: cannot locate file '%s' - please run '%s' to fix this"), "$BASE_DIR/$path", "update-gosa"); + exit; + } } } diff --git a/gosa-core/include/functions.inc b/gosa-core/include/functions.inc index b1123007d..50fb2868c 100644 --- a/gosa-core/include/functions.inc +++ b/gosa-core/include/functions.inc @@ -96,7 +96,7 @@ function __autoload($class_name) { if (isset($class_mapping[$class_name])){ require_once($BASE_DIR."/".$class_mapping[$class_name]); } else { - echo sprintf(_("Fatal error: cannot load class '%s' - execution aborted"), $class_name); + echo sprintf(_("Fatal error: cannot instantiate class '%s' - execution aborted"), $class_name); print_a(debug_backtrace()); exit; } @@ -111,7 +111,7 @@ function plugin_available($plugin) if (!isset($class_mapping[$plugin])){ return false; } else { - return file_exists($BASE_DIR."/".$class_mapping[$plugin]); + return is_readable($BASE_DIR."/".$class_mapping[$plugin]); } } -- 2.30.2