From d34273d72b0a2fce1fed2dc926396ea8152760fe Mon Sep 17 00:00:00 2001 From: Erik Amaru Ortiz Date: Wed, 25 Jun 2014 15:02:45 -0400 Subject: [PATCH] adding displayMaveriksNotLoadedError() method on bootstrap class to validate calls to Maverics ClassLoader class --- framework/src/templates/error.phtml | 80 +++++++++++++++++++++++++++++ gulliver/system/class.bootstrap.php | 27 ++++++++++ 2 files changed, 107 insertions(+) create mode 100644 framework/src/templates/error.phtml diff --git a/framework/src/templates/error.phtml b/framework/src/templates/error.phtml new file mode 100644 index 000000000..443dcf739 --- /dev/null +++ b/framework/src/templates/error.phtml @@ -0,0 +1,80 @@ + + + + + + Runtime Exception. + + + +
+

System Error.

+
+

+ : +

+
+
+
+        
+        
+
+
+ + \ No newline at end of file diff --git a/gulliver/system/class.bootstrap.php b/gulliver/system/class.bootstrap.php index 36ec128d5..3e11bd2b8 100644 --- a/gulliver/system/class.bootstrap.php +++ b/gulliver/system/class.bootstrap.php @@ -31,6 +31,10 @@ class Bootstrap public static function registerClass($className, $includePath) { + if (! class_exists('\Maveriks\Util\ClassLoader')) { + self::displayMaveriksNotLoadedError(); + } + $loader = Maveriks\Util\ClassLoader::getInstance(); $loader->addClass($className, $includePath); } @@ -2832,5 +2836,28 @@ class Bootstrap return $result; } + + public static function displayMaveriksNotLoadedError() + { + if (! class_exists('\Maveriks\Util\ClassLoader')) { + require PATH_TRUNK . "framework/src/Maveriks/pattern/Mvc/View.php"; + require PATH_TRUNK . "framework/src/Maveriks/pattern/Mvc/PhtmlView.php"; + + $message = "Please review your apache virtual host configuration file, and be sure you have the following rules: + + + RewriteEngine On + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^(.*)$ /app.php [QSA,L] + "; + + $view = new Maveriks\Pattern\Mvc\PhtmlView(PATH_TRUNK . "framework/src/templates/error.phtml"); + $view->set("title", "Sistem Configuration Error"); + $view->set("message", htmlentities($message)); + + echo $view->getOutput(); + die(); + } + } }