From b4438b5440664b182c7b70b1cae1449c4fbcd780 Mon Sep 17 00:00:00 2001
From: Awilum
Date: Tue, 8 Jan 2013 22:54:02 +0200
Subject: [PATCH] Core Improvements: Next Round #79 #80
---
admin/index.php | 1 -
admin/themes/default/index.template.php | 2 +-
libraries/Gelato/ClassLoader/ClassLoader.php | 26 ++++-----
.../Gelato/ErrorHandler/ErrorHandler.php | 4 +-
.../Resources/Views/Errors/exception.php | 7 +++
.../Resources/Views/Errors/production.php | 58 +++++++++----------
libraries/Gelato/Validation/Valid.php | 1 +
plugins/box/backup/backup.plugin.php | 2 +-
plugins/box/blocks/blocks.plugin.php | 2 +-
plugins/box/editor/editor.plugin.php | 2 +-
.../box/filesmanager/filesmanager.plugin.php | 2 +-
.../box/information/information.plugin.php | 2 +-
plugins/box/menu/menu.plugin.php | 2 +-
plugins/box/pages/pages.plugin.php | 2 +-
plugins/box/plugins/plugins.plugin.php | 2 +-
plugins/box/sitemap/sitemap.plugin.php | 2 +-
plugins/box/snippets/snippets.plugin.php | 2 +-
plugins/box/system/system.plugin.php | 2 +-
plugins/box/themes/themes.plugin.php | 2 +-
plugins/box/users/users.plugin.php | 2 +-
plugins/captcha/captcha.plugin.php | 2 +-
plugins/markitup/markitup.plugin.php | 2 +-
plugins/sandbox/sandbox.plugin.php | 2 +-
23 files changed, 67 insertions(+), 64 deletions(-)
diff --git a/admin/index.php b/admin/index.php
index 6083842..95f8376 100644
--- a/admin/index.php
+++ b/admin/index.php
@@ -15,7 +15,6 @@
* file that was distributed with this source code.
*/
-
// Main engine defines
define('DS', DIRECTORY_SEPARATOR);
define('ROOT', rtrim(str_replace(array('admin'), array(''), dirname(__FILE__)), '\\/'));
diff --git a/admin/themes/default/index.template.php b/admin/themes/default/index.template.php
index 0dd0530..ae027c9 100644
--- a/admin/themes/default/index.template.php
+++ b/admin/themes/default/index.template.php
@@ -100,7 +100,7 @@
/
/
- © 2012 Monstra –
+ © 2012 - 2013 Monstra –
diff --git a/libraries/Gelato/ClassLoader/ClassLoader.php b/libraries/Gelato/ClassLoader/ClassLoader.php
index 1ddd9e6..e70b315 100644
--- a/libraries/Gelato/ClassLoader/ClassLoader.php
+++ b/libraries/Gelato/ClassLoader/ClassLoader.php
@@ -90,7 +90,6 @@ class ClassLoader
public static function directory($path)
{
static::$directories[] = rtrim($path, '/');
- echo rtrim($path, '/');
}
/**
@@ -160,28 +159,27 @@ class ClassLoader
public static function load($className)
{
-/*
- var_dump(static::$classes);
- die();
-*/
$className = ltrim($className, '\\');
- // Try to autoload an aliased class
-
+ /**
+ * Try to autoload an aliased class
+ */
if (isset(static::$aliases[$className])) {
return class_alias(static::$aliases[$className], $className);
}
- // Try to load a mapped class
-
+ /**
+ * Try to load a mapped class
+ */
if (isset(static::$classes[$className]) && file_exists(static::$classes[$className])) {
include static::$classes[$className];
return true;
}
- // Try to load class from a registered namespace
-
+ /**
+ * Try to load class from a registered namespace
+ */
foreach (static::$namespaces as $namespace => $path) {
if (strpos($className, $namespace) === 0) {
if (static::loadPSR0(substr($className, strlen($namespace)), $path)) {
@@ -190,8 +188,10 @@ class ClassLoader
}
}
- // Try to load a PSR-0 compatible class
- // The second call to the loadPSR0 method is used to autoload legacy code
+ /**
+ * Try to load a PSR-0 compatible class
+ * The second call to the loadPSR0 method is used to autoload legacy code
+ */
if (static::loadPSR0($className) || static::loadPSR0(strtolower($className))) {
return true;
}
diff --git a/libraries/Gelato/ErrorHandler/ErrorHandler.php b/libraries/Gelato/ErrorHandler/ErrorHandler.php
index 86055ad..5420229 100644
--- a/libraries/Gelato/ErrorHandler/ErrorHandler.php
+++ b/libraries/Gelato/ErrorHandler/ErrorHandler.php
@@ -242,7 +242,7 @@ class ErrorHandler
$error['type'] = get_class($exception);
}
- // Write to error log
+ // @todo Write to error log
/*if () {
Write here
@@ -251,7 +251,7 @@ class ErrorHandler
// Send headers and output
@header('Content-Type: text/html; charset=UTF-8');
- if (GELATO_DISPLAY_ERRORS) {
+ if (GELATO_DISPLAY_ERRORS) {
$error['backtrace'] = $exception->getTrace();
if ($exception instanceof ErrorException) {
diff --git a/libraries/Gelato/ErrorHandler/Resources/Views/Errors/exception.php b/libraries/Gelato/ErrorHandler/Resources/Views/Errors/exception.php
index 319e8a5..d07ffce 100644
--- a/libraries/Gelato/ErrorHandler/Resources/Views/Errors/exception.php
+++ b/libraries/Gelato/ErrorHandler/Resources/Views/Errors/exception.php
@@ -1,3 +1,8 @@
+
+
+
+
+Error
-
-
Error
Aw, snap! An error has occurred while processing your request.
-
+