adding displayMaveriksNotLoadedError() method on bootstrap class to validate calls to Maverics ClassLoader class
This commit is contained in:
80
framework/src/templates/error.phtml
Normal file
80
framework/src/templates/error.phtml
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||||
|
<meta name="robots" content="noindex,nofollow" />
|
||||||
|
<title>Runtime Exception.</title>
|
||||||
|
<style>
|
||||||
|
/* Copyright (c) 2010, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.com/yui/license.html */
|
||||||
|
html{ color:#000;background:#FFF; }body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{ margin:0;padding:0; }table{ border-collapse:collapse;border-spacing:0; }fieldset,img{ border:0; }address,caption,cite,code,dfn,em,strong,th,var{ font-style:normal;font-weight:normal; }li{ list-style:none; }caption,th{ text-align:left; }h1,h2,h3,h4,h5,h6{ font-size:100%;font-weight:normal; }q:before,q:after{ content:''; }abbr,acronym{ border:0;font-variant:normal; }sup{ vertical-align:text-top; }sub{ vertical-align:text-bottom; }input,textarea,select{ font-family:inherit;font-size:inherit;font-weight:inherit; }input,textarea,select{ *font-size:100%; }legend{ color:#000; }
|
||||||
|
|
||||||
|
html { background: #eee; padding: 10px }
|
||||||
|
body { font: 11px Verdana, Arial, sans-serif; color: #333 }
|
||||||
|
pre { font: 11px Verdana, Arial, sans-serif; color: #333 }
|
||||||
|
img { border: 0; }
|
||||||
|
.clear { clear:both; height:0; font-size:0; line-height:0; }
|
||||||
|
.clear_fix:after { display:block; height:0; clear:both; visibility:hidden; }
|
||||||
|
.clear_fix { display:inline-block; }
|
||||||
|
* html .clear_fix { height:1%; }
|
||||||
|
.clear_fix { display:block; }
|
||||||
|
#content { width:970px; margin:0 auto; }
|
||||||
|
.sf-exceptionreset, .sf-exceptionreset .block { margin: auto }
|
||||||
|
.sf-exceptionreset abbr { border-bottom: 1px dotted #000; cursor: help; }
|
||||||
|
.sf-exceptionreset p { font-size:14px; line-height:20px; color:#868686; padding-bottom:20px }
|
||||||
|
.sf-exceptionreset strong { font-weight:bold; }
|
||||||
|
.sf-exceptionreset a { color:#6c6159; }
|
||||||
|
.sf-exceptionreset a img { border:none; }
|
||||||
|
.sf-exceptionreset a:hover { text-decoration:underline; }
|
||||||
|
.sf-exceptionreset em { font-style:italic; }
|
||||||
|
.sf-exceptionreset h1, .sf-exceptionreset h2 { font: 20px Georgia, "Times New Roman", Times, serif }
|
||||||
|
.sf-exceptionreset h2 span { background-color: #fff; color: #333; padding: 6px; float: left; margin-right: 10px; }
|
||||||
|
.sf-exceptionreset .traces li { font-size:12px; padding: 2px 4px; list-style-type:decimal; margin-left:20px; }
|
||||||
|
.sf-exceptionreset .block { background-color:#FFFFFF; padding:10px 28px; margin-bottom:20px;
|
||||||
|
-webkit-border-bottom-right-radius: 16px;
|
||||||
|
-webkit-border-bottom-left-radius: 16px;
|
||||||
|
-moz-border-radius-bottomright: 16px;
|
||||||
|
-moz-border-radius-bottomleft: 16px;
|
||||||
|
border-bottom-right-radius: 16px;
|
||||||
|
border-bottom-left-radius: 16px;
|
||||||
|
border-bottom:1px solid #ccc;
|
||||||
|
border-right:1px solid #ccc;
|
||||||
|
border-left:1px solid #ccc;
|
||||||
|
}
|
||||||
|
.sf-exceptionreset .block_exception { background-color:#ddd; color: #333; padding:20px;
|
||||||
|
-webkit-border-top-left-radius: 16px;
|
||||||
|
-webkit-border-top-right-radius: 16px;
|
||||||
|
-moz-border-radius-topleft: 16px;
|
||||||
|
-moz-border-radius-topright: 16px;
|
||||||
|
border-top-left-radius: 16px;
|
||||||
|
border-top-right-radius: 16px;
|
||||||
|
border-top:1px solid #ccc;
|
||||||
|
border-right:1px solid #ccc;
|
||||||
|
border-left:1px solid #ccc;
|
||||||
|
}
|
||||||
|
.sf-exceptionreset li a { background:none; color:#868686; text-decoration:none; }
|
||||||
|
.sf-exceptionreset li a:hover { background:none; color:#313131; text-decoration:underline; }
|
||||||
|
.sf-exceptionreset ol { padding: 10px 0; }
|
||||||
|
.sf-exceptionreset h1 { background-color:#FFFFFF; padding: 15px 28px; margin-bottom: 20px;
|
||||||
|
-webkit-border-radius: 10px;
|
||||||
|
-moz-border-radius: 10px;
|
||||||
|
border-radius: 10px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="content" class="sf-exceptionreset">
|
||||||
|
<h1>System Error.</h1>
|
||||||
|
<div class="block_exception clear_fix">
|
||||||
|
<h2>
|
||||||
|
<abbr title="RuntimeException"><?php echo $title?></abbr>:
|
||||||
|
</h2>
|
||||||
|
</div>
|
||||||
|
<div class="block">
|
||||||
|
<pre>
|
||||||
|
<?php echo $message?>
|
||||||
|
</pre>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -31,6 +31,10 @@ class Bootstrap
|
|||||||
|
|
||||||
public static function registerClass($className, $includePath)
|
public static function registerClass($className, $includePath)
|
||||||
{
|
{
|
||||||
|
if (! class_exists('\Maveriks\Util\ClassLoader')) {
|
||||||
|
self::displayMaveriksNotLoadedError();
|
||||||
|
}
|
||||||
|
|
||||||
$loader = Maveriks\Util\ClassLoader::getInstance();
|
$loader = Maveriks\Util\ClassLoader::getInstance();
|
||||||
$loader->addClass($className, $includePath);
|
$loader->addClass($className, $includePath);
|
||||||
}
|
}
|
||||||
@@ -2832,5 +2836,28 @@ class Bootstrap
|
|||||||
|
|
||||||
return $result;
|
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:
|
||||||
|
|
||||||
|
<IfModule mod_rewrite.c>
|
||||||
|
RewriteEngine On
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
|
RewriteRule ^(.*)$ /app.php [QSA,L]
|
||||||
|
</IfModule>";
|
||||||
|
|
||||||
|
$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();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user