diff --git a/modules/application/composers.php b/application/composers.php
similarity index 100%
rename from modules/application/composers.php
rename to application/composers.php
diff --git a/modules/application/config/.gitignore b/application/config/.gitignore
similarity index 100%
rename from modules/application/config/.gitignore
rename to application/config/.gitignore
diff --git a/application/config/aliases.php b/application/config/aliases.php
new file mode 100644
index 00000000..d18c90a1
--- /dev/null
+++ b/application/config/aliases.php
@@ -0,0 +1,48 @@
+ 'Laravel\\Asset',
+ 'Auth' => 'Laravel\\Auth',
+ 'Benchmark' => 'Laravel\\Benchmark',
+ 'Cache' => 'Laravel\\Cache',
+ 'Config' => 'Laravel\\Config',
+ 'Cookie' => 'Laravel\\Cookie',
+ 'Crypter' => 'Laravel\\Crypter',
+ 'DB' => 'Laravel\\DB',
+ 'Eloquent' => 'Laravel\\DB\\Eloquent\\Model',
+ 'File' => 'Laravel\\File',
+ 'Form' => 'Laravel\\Form',
+ 'Hasher' => 'Laravel\\Hasher',
+ 'HTML' => 'Laravel\\HTML',
+ 'Inflector' => 'Laravel\\Inflector',
+ 'Input' => 'Laravel\\Input',
+ 'Lang' => 'Laravel\\Lang',
+ 'Loader' => 'Laravel\\Loader',
+ 'Package' => 'Laravel\\Package',
+ 'URL' => 'Laravel\\URL',
+ 'Redirect' => 'Laravel\\Redirect',
+ 'Request' => 'Laravel\\Request',
+ 'Response' => 'Laravel\\Response',
+ 'Session' => 'Laravel\\Session',
+ 'Str' => 'Laravel\\Str',
+ 'Validator' => 'Laravel\\Validator',
+ 'View' => 'Laravel\\View',
+
+);
\ No newline at end of file
diff --git a/modules/application/config/application.php b/application/config/application.php
similarity index 100%
rename from modules/application/config/application.php
rename to application/config/application.php
diff --git a/application/config/ascii.php b/application/config/ascii.php
new file mode 100644
index 00000000..def811d6
--- /dev/null
+++ b/application/config/ascii.php
@@ -0,0 +1,73 @@
+ 'ae',
+ '/œ/' => 'oe',
+ '/À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ|А/' => 'A',
+ '/à|á|â|ã|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'/Ţ|Ť|Ŧ|Т/' => 'T',
+ '/ţ|ť|ŧ|т/' => 't',
+ '/Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ|У/' => 'U',
+ '/ù|ú|û|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ|у/' => 'u',
+ '/В/' => 'V',
+ '/в/' => 'v',
+ '/Ý|Ÿ|Ŷ|Ы/' => 'Y',
+ '/ý|ÿ|ŷ|ы/' => 'y',
+ '/Ŵ/' => 'W',
+ '/ŵ/' => 'w',
+ '/Ź|Ż|Ž|З/' => 'Z',
+ '/ź|ż|ž|з/' => 'z',
+ '/Æ|Ǽ/' => 'AE',
+ '/ß/'=> 'ss',
+ '/IJ/' => 'IJ',
+ '/ij/' => 'ij',
+ '/Œ/' => 'OE',
+ '/Ч/' => 'Ch',
+ '/ч/' => 'ch',
+ '/Ю/' => 'Ju',
+ '/ю/' => 'ju',
+ '/Я/' => 'Ja',
+ '/я/' => 'ja',
+ '/Ш/' => 'Sh',
+ '/ш/' => 'sh',
+ '/Щ/' => 'Shch',
+ '/щ/' => 'shch',
+ '/Ж/' => 'Zh',
+ '/ж/' => 'zh',
+
+);
\ No newline at end of file
diff --git a/modules/application/config/auth.php b/application/config/auth.php
similarity index 100%
rename from modules/application/config/auth.php
rename to application/config/auth.php
diff --git a/modules/application/config/cache.php b/application/config/cache.php
similarity index 100%
rename from modules/application/config/cache.php
rename to application/config/cache.php
diff --git a/modules/application/config/db.php b/application/config/db.php
similarity index 100%
rename from modules/application/config/db.php
rename to application/config/db.php
diff --git a/modules/application/config/error.php b/application/config/error.php
similarity index 100%
rename from modules/application/config/error.php
rename to application/config/error.php
diff --git a/application/config/mimes.php b/application/config/mimes.php
new file mode 100644
index 00000000..e2bd4fbb
--- /dev/null
+++ b/application/config/mimes.php
@@ -0,0 +1,97 @@
+ 'application/mac-binhex40',
+ 'cpt' => 'application/mac-compactpro',
+ 'csv' => array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream'),
+ 'bin' => 'application/macbinary',
+ 'dms' => 'application/octet-stream',
+ 'lha' => 'application/octet-stream',
+ 'lzh' => 'application/octet-stream',
+ 'exe' => array('application/octet-stream', 'application/x-msdownload'),
+ 'class' => 'application/octet-stream',
+ 'psd' => 'application/x-photoshop',
+ 'so' => 'application/octet-stream',
+ 'sea' => 'application/octet-stream',
+ 'dll' => 'application/octet-stream',
+ 'oda' => 'application/oda',
+ 'pdf' => array('application/pdf', 'application/x-download'),
+ 'ai' => 'application/postscript',
+ 'eps' => 'application/postscript',
+ 'ps' => 'application/postscript',
+ 'smi' => 'application/smil',
+ 'smil' => 'application/smil',
+ 'mif' => 'application/vnd.mif',
+ 'xls' => array('application/excel', 'application/vnd.ms-excel', 'application/msexcel'),
+ 'ppt' => array('application/powerpoint', 'application/vnd.ms-powerpoint'),
+ 'wbxml' => 'application/wbxml',
+ 'wmlc' => 'application/wmlc',
+ 'dcr' => 'application/x-director',
+ 'dir' => 'application/x-director',
+ 'dxr' => 'application/x-director',
+ 'dvi' => 'application/x-dvi',
+ 'gtar' => 'application/x-gtar',
+ 'gz' => 'application/x-gzip',
+ 'php' => array('application/x-httpd-php', 'text/x-php'),
+ 'php4' => 'application/x-httpd-php',
+ 'php3' => 'application/x-httpd-php',
+ 'phtml' => 'application/x-httpd-php',
+ 'phps' => 'application/x-httpd-php-source',
+ 'js' => 'application/x-javascript',
+ 'swf' => 'application/x-shockwave-flash',
+ 'sit' => 'application/x-stuffit',
+ 'tar' => 'application/x-tar',
+ 'tgz' => array('application/x-tar', 'application/x-gzip-compressed'),
+ 'xhtml' => 'application/xhtml+xml',
+ 'xht' => 'application/xhtml+xml',
+ 'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed'),
+ 'mid' => 'audio/midi',
+ 'midi' => 'audio/midi',
+ 'mpga' => 'audio/mpeg',
+ 'mp2' => 'audio/mpeg',
+ 'mp3' => array('audio/mpeg', 'audio/mpg', 'audio/mpeg3', 'audio/mp3'),
+ 'aif' => 'audio/x-aiff',
+ 'aiff' => 'audio/x-aiff',
+ 'aifc' => 'audio/x-aiff',
+ 'ram' => 'audio/x-pn-realaudio',
+ 'rm' => 'audio/x-pn-realaudio',
+ 'rpm' => 'audio/x-pn-realaudio-plugin',
+ 'ra' => 'audio/x-realaudio',
+ 'rv' => 'video/vnd.rn-realvideo',
+ 'wav' => 'audio/x-wav',
+ 'bmp' => 'image/bmp',
+ 'gif' => 'image/gif',
+ 'jpeg' => array('image/jpeg', 'image/pjpeg'),
+ 'jpg' => array('image/jpeg', 'image/pjpeg'),
+ 'jpe' => array('image/jpeg', 'image/pjpeg'),
+ 'png' => 'image/png',
+ 'tiff' => 'image/tiff',
+ 'tif' => 'image/tiff',
+ 'css' => 'text/css',
+ 'html' => 'text/html',
+ 'htm' => 'text/html',
+ 'shtml' => 'text/html',
+ 'txt' => 'text/plain',
+ 'text' => 'text/plain',
+ 'log' => array('text/plain', 'text/x-log'),
+ 'rtx' => 'text/richtext',
+ 'rtf' => 'text/rtf',
+ 'xml' => 'text/xml',
+ 'xsl' => 'text/xml',
+ 'mpeg' => 'video/mpeg',
+ 'mpg' => 'video/mpeg',
+ 'mpe' => 'video/mpeg',
+ 'qt' => 'video/quicktime',
+ 'mov' => 'video/quicktime',
+ 'avi' => 'video/x-msvideo',
+ 'movie' => 'video/x-sgi-movie',
+ 'doc' => 'application/msword',
+ 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
+ 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
+ 'word' => array('application/msword', 'application/octet-stream'),
+ 'xl' => 'application/excel',
+ 'eml' => 'message/rfc822',
+ 'json' => array('application/json', 'text/json'),
+
+);
\ No newline at end of file
diff --git a/modules/application/config/session.php b/application/config/session.php
similarity index 100%
rename from modules/application/config/session.php
rename to application/config/session.php
diff --git a/modules/application/filters.php b/application/filters.php
similarity index 100%
rename from modules/application/filters.php
rename to application/filters.php
diff --git a/modules/application/libraries/.gitignore b/application/libraries/.gitignore
similarity index 100%
rename from modules/application/libraries/.gitignore
rename to application/libraries/.gitignore
diff --git a/modules/application/models/.gitignore b/application/models/.gitignore
similarity index 100%
rename from modules/application/models/.gitignore
rename to application/models/.gitignore
diff --git a/modules/application/routes.php b/application/routes.php
similarity index 100%
rename from modules/application/routes.php
rename to application/routes.php
diff --git a/modules/application/views/error/404.php b/application/views/error/404.php
similarity index 100%
rename from modules/application/views/error/404.php
rename to application/views/error/404.php
diff --git a/modules/application/views/error/500.php b/application/views/error/500.php
similarity index 100%
rename from modules/application/views/error/500.php
rename to application/views/error/500.php
diff --git a/modules/application/views/error/exception.php b/application/views/error/exception.php
similarity index 100%
rename from modules/application/views/error/exception.php
rename to application/views/error/exception.php
diff --git a/modules/application/views/home/index.php b/application/views/home/index.php
similarity index 100%
rename from modules/application/views/home/index.php
rename to application/views/home/index.php
diff --git a/laravel/auth.php b/laravel/auth.php
index 381cd3ad..86bbcabf 100644
--- a/laravel/auth.php
+++ b/laravel/auth.php
@@ -21,6 +21,13 @@ class Auth {
*/
protected $session;
+ /**
+ * The hashing engine that should be used to perform hashing.
+ *
+ * @var Hash\Engine
+ */
+ protected $hasher;
+
/**
* The key used to store the user ID in the session.
*
@@ -31,11 +38,13 @@ class Auth {
/**
* Create a new Auth class instance.
*
- * @param Session\Driver $session_driver
+ * @param Session\Driver $driver
+ * @param Hash\Engine $hasher
* @return void
*/
- public function __construct(Session\Driver $driver)
+ public function __construct(Session\Driver $driver, Hash\Engine $hasher)
{
+ $this->hasher = $hasher;
$this->session = $driver;
}
@@ -97,7 +106,7 @@ public function login($username, $password)
{
if ( ! is_null($user = call_user_func(Config::get('auth.by_username'), $username)))
{
- if (Hash::check($password, $user->password))
+ if ($this->hasher->check($password, $user->password))
{
$this->remember($user);
@@ -142,22 +151,4 @@ public function logout()
$this->session->forget(static::$key);
}
- /**
- * Pass all other methods to a generic Auth instance.
- *
- * This provides a convenient API for working with the default Auth configuration.
- *
- *
- * // Get the current user of your application
- * $user = Auth::user();
- *
- * // Equivalent call using make method
- * $user = Auth::make()->user();
- *
- */
- public static function __callStatic($method, $parameters)
- {
- return call_user_func_array(array(new static(Session::driver()), $method), $parameters);
- }
-
}
\ No newline at end of file
diff --git a/laravel/config/aliases.php b/laravel/config/aliases.php
index 43bc470b..d18c90a1 100644
--- a/laravel/config/aliases.php
+++ b/laravel/config/aliases.php
@@ -29,7 +29,7 @@
'Eloquent' => 'Laravel\\DB\\Eloquent\\Model',
'File' => 'Laravel\\File',
'Form' => 'Laravel\\Form',
- 'Hash' => 'Laravel\\Hash',
+ 'Hasher' => 'Laravel\\Hasher',
'HTML' => 'Laravel\\HTML',
'Inflector' => 'Laravel\\Inflector',
'Input' => 'Laravel\\Input',
diff --git a/laravel/form.php b/laravel/form.php
index c53486fe..63a25f55 100644
--- a/laravel/form.php
+++ b/laravel/form.php
@@ -3,7 +3,10 @@
class Form {
/**
- * Stores labels names.
+ * All of the label names that have been created.
+ *
+ * These names are stored so that input elements can automatically be assigned
+ * an ID based on the corresponding label name.
*
* @var array
*/
@@ -12,6 +15,21 @@ class Form {
/**
* Open a HTML form.
*
+ *
+ * // Open a POST form for the current URI
+ * echo Form::open();
+ *
+ * // Open a POST form to a specified URI
+ * echo Form::open('user/login');
+ *
+ * // Open a PUT form to a specified URI
+ * echo Form::open('user/profile', 'put');
+ *
+ *
+ * Note: If PUT or DELETE is specified as the form method, a hidden input field will be generated
+ * containing the request method. PUT and DELETE are not supported by HTML forms, so the
+ * hidden field will allow us to "spoof" PUT and DELETE requests.
+ *
* @param string $action
* @param string $method
* @param array $attributes
@@ -20,29 +38,48 @@ class Form {
*/
public static function open($action = null, $method = 'POST', $attributes = array(), $https = false)
{
- $attributes['action'] = HTML::entities(URL::to(((is_null($action)) ? Request::uri() : $action), $https));
-
- // PUT and DELETE methods are spoofed using a hidden field containing the request method.
- // Since, HTML does not support PUT and DELETE on forms, we will use POST.
- $attributes['method'] = ($method == 'PUT' or $method == 'DELETE') ? 'POST' : $method;
+ list($attributes['action'], $attributes['method']) = array(static::action($action, $https), static::method($method));
if ( ! array_key_exists('accept-charset', $attributes))
{
$attributes['accept-charset'] = Config::get('application.encoding');
}
- $html = '