cleaning up various codes.
This commit is contained in:
parent
78dc4529f1
commit
007863a6fa
|
@ -134,9 +134,6 @@ public static function attempt($username, $password = null, $remember = false)
|
|||
// or authentication provider they wish.
|
||||
$user = call_user_func($config['attempt'], $username, $password);
|
||||
|
||||
// If the user credentials were authenticated by the closure, we will
|
||||
// log the user into the application, which will store their user ID
|
||||
// in the session for subsequent requests.
|
||||
if (is_null($user)) return false;
|
||||
|
||||
static::login($user, $remember);
|
||||
|
|
|
@ -64,4 +64,6 @@
|
|||
* be the default timezone used by all date functions through
|
||||
* throughout the entire application.
|
||||
*/
|
||||
date_default_timezone_set(Config::get('application.timezone'));
|
||||
$timezone = Config::get('application.timezone');
|
||||
|
||||
date_default_timezone_set($timezone);
|
|
@ -14,8 +14,7 @@ public static function exception($exception)
|
|||
|
||||
// If detailed errors are enabled, we'll just format the exception into
|
||||
// a simple error message and display it on the screen. We don't use a
|
||||
// View in case the problem is in the View class itself so we can not
|
||||
// run into a white screen of death situation.
|
||||
// View in case the problem is in the View class.
|
||||
if (Config::get('error.detail'))
|
||||
{
|
||||
echo "<html><h2>Unhandled Exception</h2>
|
||||
|
@ -50,7 +49,7 @@ public static function native($code, $error, $file, $line)
|
|||
// For a PHP error, we'll create an ErrorExcepetion and then feed that
|
||||
// exception to the exception method, which will create a simple view
|
||||
// of the exception details. The ErrorException class is built-in to
|
||||
// PHP for converting native errors to Exceptions.
|
||||
// PHP for converting native errors.
|
||||
$exception = new \ErrorException($error, $code, 0, $file, $line);
|
||||
|
||||
if (in_array($code, Config::get('error.ignore')))
|
||||
|
|
|
@ -36,7 +36,7 @@ public static function make($value, $rounds = 8)
|
|||
// Bcrypt expects the salt to be 22 base64 encoded characters including
|
||||
// dots and slashes. We will get rid of the plus signs included in the
|
||||
// base64 data and replace them with dots. OpenSSL will be used if it
|
||||
// is available, otherwise we will use the Str::random method.
|
||||
// is available on the server.
|
||||
if (function_exists('openssl_random_pseudo_bytes'))
|
||||
{
|
||||
$salt = openssl_random_pseudo_bytes(16);
|
||||
|
|
|
@ -79,9 +79,8 @@ public static function call($destination, $parameters = array())
|
|||
protected static function backreference($method, $parameters)
|
||||
{
|
||||
// Controller delegates may use back-references to the action parameters,
|
||||
// which allows the developer to setup more flexible rouets to their
|
||||
// controllers with less code. We will replace the back-references
|
||||
// with their corresponding parameter value.
|
||||
// which allows the developer to setup more flexible routes to various
|
||||
// controllers with much less code than usual.
|
||||
foreach ($parameters as $key => $value)
|
||||
{
|
||||
$method = str_replace('(:'.($key + 1).')', $value, $method, $count);
|
||||
|
@ -158,13 +157,7 @@ protected static function load($bundle, $controller)
|
|||
*/
|
||||
protected static function format($bundle, $controller)
|
||||
{
|
||||
// If the controller's bundle is not the application bundle, we will
|
||||
// prepend the bundle to the identifier so the bundle is prefixed to
|
||||
// the class name when it is formatted. Bundle controllers are
|
||||
// always prefixed with the bundle name.
|
||||
if ($bundle !== DEFAULT_BUNDLE) $controller = $bundle.'.'.$controller;
|
||||
|
||||
return Str::classify($controller).'_Controller';
|
||||
return Bundle::class_prefix($bundle).Str::classify($controller).'_Controller';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue