1
0
mirror of https://github.com/monstra-cms/monstra.git synced 2025-08-03 19:57:57 +02:00

Core Improvements: Next Round #79 #80

This commit is contained in:
Awilum
2013-01-08 22:54:02 +02:00
parent 7e71457a2e
commit b4438b5440
23 changed files with 67 additions and 64 deletions

View File

@@ -15,7 +15,6 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
// Main engine defines // Main engine defines
define('DS', DIRECTORY_SEPARATOR); define('DS', DIRECTORY_SEPARATOR);
define('ROOT', rtrim(str_replace(array('admin'), array(''), dirname(__FILE__)), '\\/')); define('ROOT', rtrim(str_replace(array('admin'), array(''), dirname(__FILE__)), '\\/'));

View File

@@ -100,7 +100,7 @@
<span style="border-top:1px solid #E0E0E0; padding-top:10px;"> <span style="border-top:1px solid #E0E0E0; padding-top:10px;">
<a href="http://forum.monstra.org" target="_blank"><?php echo __('Official Support Forum', 'system'); ?></a> / <a href="http://forum.monstra.org" target="_blank"><?php echo __('Official Support Forum', 'system'); ?></a> /
<a href="http://monstra.org/documentation" target="_blank"><?php echo __('Documentation', 'system'); ?></a> / <a href="http://monstra.org/documentation" target="_blank"><?php echo __('Documentation', 'system'); ?></a> /
© 2012 <a href="http://monstra.org" target="_blank">Monstra</a> <?php echo __('Version', 'system'); ?> <?php echo Monstra::VERSION; ?> © 2012 - 2013 <a href="http://monstra.org" target="_blank">Monstra</a> <?php echo __('Version', 'system'); ?> <?php echo Monstra::VERSION; ?>
</span> </span>
</p> </p>
</footer> </footer>

View File

@@ -90,7 +90,6 @@ class ClassLoader
public static function directory($path) public static function directory($path)
{ {
static::$directories[] = rtrim($path, '/'); static::$directories[] = rtrim($path, '/');
echo rtrim($path, '/');
} }
/** /**
@@ -160,28 +159,27 @@ class ClassLoader
public static function load($className) public static function load($className)
{ {
/*
var_dump(static::$classes);
die();
*/
$className = ltrim($className, '\\'); $className = ltrim($className, '\\');
// Try to autoload an aliased class /**
* Try to autoload an aliased class
*/
if (isset(static::$aliases[$className])) { if (isset(static::$aliases[$className])) {
return class_alias(static::$aliases[$className], $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])) { if (isset(static::$classes[$className]) && file_exists(static::$classes[$className])) {
include static::$classes[$className]; include static::$classes[$className];
return true; return true;
} }
// Try to load class from a registered namespace /**
* Try to load class from a registered namespace
*/
foreach (static::$namespaces as $namespace => $path) { foreach (static::$namespaces as $namespace => $path) {
if (strpos($className, $namespace) === 0) { if (strpos($className, $namespace) === 0) {
if (static::loadPSR0(substr($className, strlen($namespace)), $path)) { 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))) { if (static::loadPSR0($className) || static::loadPSR0(strtolower($className))) {
return true; return true;
} }

View File

@@ -242,7 +242,7 @@ class ErrorHandler
$error['type'] = get_class($exception); $error['type'] = get_class($exception);
} }
// Write to error log // @todo Write to error log
/*if () { /*if () {
Write here Write here

View File

@@ -1,3 +1,8 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
<style type="text/css"> <style type="text/css">
* { margin: 0; padding: 0; } * { margin: 0; padding: 0; }
#gelato-error #gelato-error
@@ -223,3 +228,5 @@ function toggle(id, link)
return false; return false;
} }
</script> </script>
</body>
</html>

View File

@@ -1,11 +1,9 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset=""> <meta charset="utf-8">
<title>Error</title> <title>Error</title>
<style type="text/css"> <style type="text/css">
body body
{ {
height:100%; height:100%;
@@ -56,10 +54,8 @@ hr
padding:10px; padding:10px;
} }
</style> </style>
</head> </head>
<body> <body>
<div id="message"> <div id="message">
<h1>Error</h1> <h1>Error</h1>
<hr> <hr>

View File

@@ -14,6 +14,7 @@
* For the full copyright and license information, please view the LICENSE * For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
class Valid class Valid
{ {
/** /**

View File

@@ -6,7 +6,7 @@
* @package Monstra * @package Monstra
* @subpackage Plugins * @subpackage Plugins
* @author Romanenko Sergey / Awilum * @author Romanenko Sergey / Awilum
* @copyright 2012 Romanenko Sergey / Awilum * @copyright 2012-2013 Romanenko Sergey / Awilum
* @version 1.0.0 * @version 1.0.0
* *
*/ */

View File

@@ -6,7 +6,7 @@
* @package Monstra * @package Monstra
* @subpackage Plugins * @subpackage Plugins
* @author Romanenko Sergey / Awilum * @author Romanenko Sergey / Awilum
* @copyright 2012 Romanenko Sergey / Awilum * @copyright 2012-2013 Romanenko Sergey / Awilum
* @version 1.0.0 * @version 1.0.0
* *
*/ */

View File

@@ -6,7 +6,7 @@
* @package Monstra * @package Monstra
* @subpackage Plugins * @subpackage Plugins
* @author Romanenko Sergey / Awilum * @author Romanenko Sergey / Awilum
* @copyright 2012 Romanenko Sergey / Awilum * @copyright 2012-2013 Romanenko Sergey / Awilum
* @version 1.0.0 * @version 1.0.0
* *
*/ */

View File

@@ -6,7 +6,7 @@
* @package Monstra * @package Monstra
* @subpackage Plugins * @subpackage Plugins
* @author Romanenko Sergey / Awilum * @author Romanenko Sergey / Awilum
* @copyright 2012 Romanenko Sergey / Awilum * @copyright 2012-2013 Romanenko Sergey / Awilum
* @version 1.0.0 * @version 1.0.0
* *
*/ */

View File

@@ -6,7 +6,7 @@
* @package Monstra * @package Monstra
* @subpackage Plugins * @subpackage Plugins
* @author Romanenko Sergey / Awilum * @author Romanenko Sergey / Awilum
* @copyright 2012 Romanenko Sergey / Awilum * @copyright 2012-2013 Romanenko Sergey / Awilum
* @version 1.0.0 * @version 1.0.0
* *
*/ */

View File

@@ -6,7 +6,7 @@
* @package Monstra * @package Monstra
* @subpackage Plugins * @subpackage Plugins
* @author Romanenko Sergey / Awilum * @author Romanenko Sergey / Awilum
* @copyright 2012 Romanenko Sergey / Awilum * @copyright 2012-2013 Romanenko Sergey / Awilum
* @version 1.0.0 * @version 1.0.0
* *
*/ */

View File

@@ -6,7 +6,7 @@
* @package Monstra * @package Monstra
* @subpackage Plugins * @subpackage Plugins
* @author Romanenko Sergey / Awilum * @author Romanenko Sergey / Awilum
* @copyright 2012 Romanenko Sergey / Awilum * @copyright 2012-2013 Romanenko Sergey / Awilum
* @version 1.0.0 * @version 1.0.0
* *
*/ */

View File

@@ -6,7 +6,7 @@
* @package Monstra * @package Monstra
* @subpackage Plugins * @subpackage Plugins
* @author Romanenko Sergey / Awilum * @author Romanenko Sergey / Awilum
* @copyright 2012 Romanenko Sergey / Awilum * @copyright 2012-2013 Romanenko Sergey / Awilum
* @version 1.0.0 * @version 1.0.0
* *
*/ */

View File

@@ -6,7 +6,7 @@
* @package Monstra * @package Monstra
* @subpackage Plugins * @subpackage Plugins
* @author Romanenko Sergey / Awilum * @author Romanenko Sergey / Awilum
* @copyright 2012 Romanenko Sergey / Awilum * @copyright 2012-2013 Romanenko Sergey / Awilum
* @version 1.0.0 * @version 1.0.0
* *
*/ */

View File

@@ -6,7 +6,7 @@
* @package Monstra * @package Monstra
* @subpackage Plugins * @subpackage Plugins
* @author Romanenko Sergey / Awilum * @author Romanenko Sergey / Awilum
* @copyright 2012 Romanenko Sergey / Awilum * @copyright 2012-2013 Romanenko Sergey / Awilum
* @version 1.0.0 * @version 1.0.0
* *
*/ */

View File

@@ -6,7 +6,7 @@
* @package Monstra * @package Monstra
* @subpackage Plugins * @subpackage Plugins
* @author Romanenko Sergey / Awilum * @author Romanenko Sergey / Awilum
* @copyright 2012 Romanenko Sergey / Awilum * @copyright 2012-2013 Romanenko Sergey / Awilum
* @version 1.0.0 * @version 1.0.0
* *
*/ */

View File

@@ -6,7 +6,7 @@
* @package Monstra * @package Monstra
* @subpackage Plugins * @subpackage Plugins
* @author Romanenko Sergey / Awilum * @author Romanenko Sergey / Awilum
* @copyright 2012 Romanenko Sergey / Awilum * @copyright 2012-2013 Romanenko Sergey / Awilum
* @version 1.0.0 * @version 1.0.0
* *
*/ */

View File

@@ -6,7 +6,7 @@
* @package Monstra * @package Monstra
* @subpackage Plugins * @subpackage Plugins
* @author Romanenko Sergey / Awilum * @author Romanenko Sergey / Awilum
* @copyright 2012 Romanenko Sergey / Awilum * @copyright 2012-2013 Romanenko Sergey / Awilum
* @version 1.0.0 * @version 1.0.0
* *
*/ */

View File

@@ -6,7 +6,7 @@
* @package Monstra * @package Monstra
* @subpackage Plugins * @subpackage Plugins
* @author Romanenko Sergey / Awilum * @author Romanenko Sergey / Awilum
* @copyright 2012 Romanenko Sergey / Awilum * @copyright 2012-2013 Romanenko Sergey / Awilum
* @version 1.0.0 * @version 1.0.0
* *
*/ */

View File

@@ -6,7 +6,7 @@
* @package Monstra * @package Monstra
* @subpackage Plugins * @subpackage Plugins
* @author Romanenko Sergey / Awilum * @author Romanenko Sergey / Awilum
* @copyright 2012 Romanenko Sergey / Awilum * @copyright 2012-2013 Romanenko Sergey / Awilum
* @version 1.0.0 * @version 1.0.0
* *
*/ */

View File

@@ -6,7 +6,7 @@
* @package Monstra * @package Monstra
* @subpackage Plugins * @subpackage Plugins
* @author Romanenko Sergey / Awilum * @author Romanenko Sergey / Awilum
* @copyright 2012 Romanenko Sergey / Awilum * @copyright 2012-2013 Romanenko Sergey / Awilum
* @version 1.0.0 * @version 1.0.0
* *
*/ */