From: cajus Date: Wed, 16 Jan 2008 16:25:02 +0000 (+0000) Subject: Added useful error messages X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=25b9a20b76b5f11d48d97fa586c6eba9adfd9019;p=gosa.git Added useful error messages git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8404 594d385d-05f5-0310-b6e9-bd551577e9d8 --- 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]); } }