diff --git a/admin/index.php b/admin/index.php
index 95f8376..512c4f6 100644
--- a/admin/index.php
+++ b/admin/index.php
@@ -21,7 +21,7 @@ define('ROOT', rtrim(str_replace(array('admin'), array(''), dirname(__FILE__)),
define('BACKEND', true);
define('MONSTRA_ACCESS', true);
-// Load bootstrap file
+// Load Monstra engine _init.php file
require_once ROOT. DS .'engine'. DS .'_init.php';
// Errors var when users login failed
@@ -33,7 +33,7 @@ $users = new Table('users');
// Admin login
if (Request::post('login_submit')) {
- $user = $users->select("[login='" . trim(Request::post('login')) . "']", null);
+ $user = $users->select("[login='" . trim(Request::post('login')) . "']", null);
if (count($user) !== 0) {
if ($user['login'] == Request::post('login')) {
if (trim($user['password']) == Security::encryptPassword(Request::post('password'))) {
diff --git a/libraries/Gelato/ClassLoader/ClassLoader.php b/libraries/Gelato/ClassLoader/ClassLoader.php
index ab49037..5f018aa 100644
--- a/libraries/Gelato/ClassLoader/ClassLoader.php
+++ b/libraries/Gelato/ClassLoader/ClassLoader.php
@@ -58,6 +58,10 @@ class ClassLoader
/**
* Add class to mapping.
+ *
+ *
+ * ClassLoader::mapClass('ClassName', 'path/to/class');
+ *
*
* @access public
* @param string $className Class name
@@ -70,6 +74,10 @@ class ClassLoader
/**
* Add multiple classes to mapping.
+ *
+ *
+ * ClassLoader::mapClasses(array('ClassName' => 'path/to/class','ClassName' => 'path/to/class'));
+ *
*
* @access public
* @param array $classes Array of classes to map (key = class name and value = class path)
@@ -83,6 +91,10 @@ class ClassLoader
/**
* Adds a PSR-0 directory path.
+ *
+ *
+ * ClassLoader::directory('path/to/classes');
+ *
*
* @access public
* @param string $path Path to PSR-0 directory
@@ -94,6 +106,10 @@ class ClassLoader
/**
* Registers a namespace.
+ *
+ *
+ * ClassLoader::registerNamespace('Namespace', '/path/to/namespace/');
+ *
*
* @access public
* @param string $namespace Namespace
@@ -106,6 +122,10 @@ class ClassLoader
/**
* Set an alias for a class.
+ *
+ *
+ * ClassLoader::registerNamespace('ClassNameAlias', 'ClassName');
+ *
*
* @access public
* @param string $alias Class alias
@@ -151,6 +171,10 @@ class ClassLoader
/**
* Autoloader.
+ *
+ *
+ * ClassLoader::load();
+ *
*
* @access public
* @param string $className Class name
diff --git a/libraries/Gelato/Registry/Registry.php b/libraries/Gelato/Registry/Registry.php
index 5b7be76..fa14d9b 100644
--- a/libraries/Gelato/Registry/Registry.php
+++ b/libraries/Gelato/Registry/Registry.php
@@ -27,17 +27,27 @@ class Registry
/**
* Checks if an object with this name is in the registry.
+ *
+ *
+ * if (Registry::exists('var')) {
+ * // Do something...
+ * }
+ *
*
* @return bool
* @param string $name The name of the registry item to check for existence.
*/
public static function exists($name)
{
- return isset(Gelato::$registry[(string) $name]);
+ return isset(Registry::$registry[(string) $name]);
}
/**
* Registers a given value under a given name.
+ *
+ *
+ * Registry::set('var', 'value');
+ *
*
* @param string $name The name of the value to store.
* @param mixed[optional] $value The value that needs to be stored.
@@ -49,16 +59,20 @@ class Registry
// delete item
if ($value === null) {
- unset(Gelato::$registry[$name]);
+ unset(Registry::$registry[$name]);
} else {
- Gelato::$registry[$name] = $value;
+ Registry::$registry[$name] = $value;
- return Gelato::get($name);
+ return Registry::get($name);
}
}
/**
* Fetch an item from the registry.
+ *
+ *
+ * $var = Registry::get('var', 'value');
+ *
*
* @return mixed
* @param string $name The name of the item to fetch.
@@ -67,11 +81,11 @@ class Registry
{
$name = (string) $name;
- if ( ! isset(Gelato::$registry[$name])) {
+ if ( ! isset(Registry::$registry[$name])) {
throw new RuntimeException('No item "' . $name . '" exists in the registry.');
}
- return Gelato::$registry[$name];
+ return Registry::$registry[$name];
}
}