diff --git a/application/config/aliases.php b/application/config/aliases.php index d7d3f4b6..7bf753df 100644 --- a/application/config/aliases.php +++ b/application/config/aliases.php @@ -30,14 +30,12 @@ return array( 'Inflector' => 'System\\Inflector', 'Input' => 'System\\Input', 'Lang' => 'System\\Lang', - 'Log' => 'System\\Log', 'URL' => 'System\\URL', 'Redirect' => 'System\\Redirect', 'Request' => 'System\\Request', 'Response' => 'System\\Response', 'Session' => 'System\\Session', 'Str' => 'System\\Str', - 'Text' => 'System\\Text', 'Validator' => 'System\\Validator', 'View' => 'System\\View', diff --git a/application/config/auth.php b/application/config/auth.php index 1f994252..979231dd 100644 --- a/application/config/auth.php +++ b/application/config/auth.php @@ -4,29 +4,39 @@ return array( /* |-------------------------------------------------------------------------- - | Authentication Model + | Retrieve Users By ID |-------------------------------------------------------------------------- | - | This model will be used by the Auth class when retrieving the users of - | your application. Feel free to change it to the name of your user model. + | This method is called by the Auth::user() method when attempting to + | retrieve a user by their user ID. | - | Note: The authentication model must be an Eloquent model. + | You are free to change this method for your application however you wish. | */ - 'model' => 'User', + 'by_id' => function($id) + { + return User::find($id); + }, /* |-------------------------------------------------------------------------- - | Authentication Username + | Retrieve Users By Username |-------------------------------------------------------------------------- | - | The authentication username is the column on your users table that - | is considered the username of the user. Typically, this is either "email" - | or "username". However, you are free to make it whatever you wish. + | This method is called by the Auth::check() method when attempting to + | retrieve a user by their username. + | + | You are free to change this method for your application however you wish. + | + | Note: This method must return an object that has an "id" and a "password" + | property. The type of object returned doesn't matter. | */ - 'username' => 'email', + 'by_username' => function($username) + { + return User::where('email', '=', $username)->first(); + }, ); \ No newline at end of file diff --git a/application/config/error.php b/application/config/error.php index dd021e46..d0029390 100644 --- a/application/config/error.php +++ b/application/config/error.php @@ -24,11 +24,32 @@ return array( | Would you like errors to be logged? Error logging can be extremely | helpful when debugging a production application. | - | Note: When error logging is enabled, errors will be logged even when - | error detail is disabled. - | */ 'log' => false, + /* + |-------------------------------------------------------------------------- + | Error Logger + |-------------------------------------------------------------------------- + | + | Because of the sundry ways of managing error logging, you get complete + | flexibility to manage error logging as you see fit. + | + | This function will be called when an error occurs in your application. + | You can log the error however you like. + | + | The error "severity" passed to the method is a human-readable severity + | level such as "Parsing Error", "Fatal Error", etc. + | + | A simple logging system has been setup for you. By default, all errors + | will be logged to the application/log.txt file. + | + */ + + 'logger' => function($severity, $message) + { + System\File::append(APP_PATH.'storage/log.txt', date('Y-m-d H:i:s').' '.$severity.' - '.$message.PHP_EOL); + }, + ); \ No newline at end of file diff --git a/application/lang/en/validation.php b/application/lang/en/validation.php index fa09a0be..46a72f4d 100644 --- a/application/lang/en/validation.php +++ b/application/lang/en/validation.php @@ -2,50 +2,25 @@ return array( - /* - |-------------------------------------------------------------------------- - | General Validation Messages - |-------------------------------------------------------------------------- - */ - - "acceptance_of" => "The :attribute must be accepted.", - "confirmation_of" => "The :attribute confirmation does not match.", - "exclusion_of" => "The :attribute value is invalid.", - "format_of" => "The :attribute format is invalid.", - "inclusion_of" => "The :attribute value is invalid.", - "presence_of" => "The :attribute can't be empty.", - "uniqueness_of" => "The :attribute has already been taken.", - "with_callback" => "The :attribute is invalid.", - - /* - |-------------------------------------------------------------------------- - | Numericality_Of Validation Messages - |-------------------------------------------------------------------------- - */ - - "number_not_valid" => "The :attribute must be a number.", - "number_not_integer" => "The :attribute must be an integer.", - "number_wrong_size" => "The :attribute must be :size.", - "number_too_big" => "The :attribute must be no more than :max.", - "number_too_small" => "The :attribute must be at least :min.", - - /* - |-------------------------------------------------------------------------- - | Length_Of Validation Messages - |-------------------------------------------------------------------------- - */ - - "string_wrong_size" => "The :attribute must be :size characters.", - "string_too_big" => "The :attribute must be no more than :max characters.", - "string_too_small" => "The :attribute must be at least :min characters.", - - /* - |-------------------------------------------------------------------------- - | Upload_Of Validation Messages - |-------------------------------------------------------------------------- - */ - - "file_wrong_type" => "The :attribute must be a file of type: :types.", - "file_too_big" => "The :attribute exceeds size limit of :maxkb.", + "accepted" => "The :attribute must be accepted.", + "active_url" => "The :attribute does not exist.", + "alpha" => "The :attribute may only contain letters.", + "alpha_dash" => "The :attribute may only contain letters, numbers, dashes, and underscores.", + "alpha_num" => "The :attribute may only contain letters and numbers.", + "between" => "The :attribute must be between :min - :max.", + "confirmed" => "The :attribute confirmation does not match.", + "email" => "The :attribute format is invalid.", + "image" => "The :attribute must be an image.", + "in" => "The selected :attribute is invalid.", + "integer" => "The :attribute must be an integer.", + "max" => "The :attribute must be less than :max.", + "mimes" => "The :attribute must be a file of type: :values.", + "min" => "The :attribute must be at least :min.", + "not_in" => "The selected :attribute is invalid.", + "numeric" => "The :attribute must be a number.", + "required" => "The :attribute field is required.", + "size" => "The :attribute must be :size.", + "unique" => "The :attribute has already been taken.", + "url" => "The :attribute format is invalid.", ); \ No newline at end of file diff --git a/application/routes.php b/application/routes.php index e9f03c02..2f7242be 100644 --- a/application/routes.php +++ b/application/routes.php @@ -7,13 +7,10 @@ return array( | Application Routes |-------------------------------------------------------------------------- | - | Here is the "definition", or the public API, of your application. + | Here is the public API of your application. To add functionality to your + | application, you just add to the array located in this file. | - | To add functionality to your application, you add to the array located - | in this file. It's a breeze. Just tell Laravel the request method and - | URI a function should respond to. - | - | To learn more, check out: http://laravel.com/docs/basics/routes + | It's a breeze. Simply tell Laravel the request URIs it should respond to. | */ diff --git a/application/storage/logs/.gitignore b/application/storage/log.txt similarity index 100% rename from application/storage/logs/.gitignore rename to application/storage/log.txt diff --git a/application/views/error/404.php b/application/views/error/404.php index beca7493..9fe78810 100644 --- a/application/views/error/404.php +++ b/application/views/error/404.php @@ -4,53 +4,84 @@