refactoring and adding more dependency injection through ioc container.

This commit is contained in:
Taylor Otwell
2011-08-24 22:51:32 -05:00
parent 99adf09ac7
commit 6a8aafc259
46 changed files with 1039 additions and 1276 deletions

View File

@@ -48,6 +48,24 @@ class Auth {
$this->session = $driver;
}
/**
* Create a new Auth class instance.
*
* If no session driver or hasher is provided, the default implementations will be used.
*
* @param Session\Driver $driver
* @param Hash\Engine $hasher
* @return void
*/
public static function make(Session\Driver $driver = null, Hash\Engine $hasher = null)
{
if (is_null($driver)) $driver = Session::driver();
if (is_null($hasher)) $hasher = Hasher::make();
return new static($driver, $hasher);
}
/**
* Determine if the current user of the application is authenticated.
*