added more facades.
This commit is contained in:
parent
31e2c1c49e
commit
2d170e2314
|
@ -19,19 +19,19 @@
|
|||
*/
|
||||
|
||||
'Asset' => 'Laravel\\Asset',
|
||||
'Auth' => 'Laravel\\Security\\Authenticator',
|
||||
'Auth' => 'Laravel\\Security\\Authenticator_Facade',
|
||||
'Benchmark' => 'Laravel\\Benchmark',
|
||||
'Cache' => 'Laravel\\Cache\\Manager',
|
||||
'Cache' => 'Laravel\\Cache\\Manager_Facade',
|
||||
'Config' => 'Laravel\\Config_Facade',
|
||||
'Cookie' => 'Laravel\\Cookie_Facade',
|
||||
'Crypter' => 'Laravel\\Security\\Crypter',
|
||||
'DB' => 'Laravel\\Database\\Manager',
|
||||
'Crypter' => 'Laravel\\Security\\Crypter_Facade',
|
||||
'DB' => 'Laravel\\Database\\Manager_Facade',
|
||||
'Download' => 'Laravel\\Download_Facade',
|
||||
'Eloquent' => 'Laravel\\Database\\Eloquent\\Model',
|
||||
'Error' => 'Laravel\\Error',
|
||||
'File' => 'Laravel\\File_Facade',
|
||||
'Form' => 'Laravel\\Form_Facade',
|
||||
'Hasher' => 'Laravel\\Security\\Hasher',
|
||||
'Hasher' => 'Laravel\\Security\\Hashing\\Hasher_Facade',
|
||||
'HTML' => 'Laravel\\HTML_Facade',
|
||||
'Inflector' => 'Laravel\\Inflector',
|
||||
'Input' => 'Laravel\\Input_Facade',
|
||||
|
@ -43,9 +43,9 @@
|
|||
'Redirect' => 'Laravel\\Redirect_Facade',
|
||||
'Request' => 'Laravel\\Request_Facade',
|
||||
'Response' => 'Laravel\\Response_Facade',
|
||||
'Session' => 'Laravel\\Session\\Manager',
|
||||
'Session' => 'Laravel\\Session\\Manager_Facade',
|
||||
'Str' => 'Laravel\\Str',
|
||||
'Validator' => 'Laravel\\Validation\\Validator',
|
||||
'Validator' => 'Laravel\\Validation\\Validator_Facade',
|
||||
'View' => 'Laravel\\View_Facade',
|
||||
|
||||
);
|
|
@ -1,7 +1,10 @@
|
|||
<?php namespace Laravel\Cache;
|
||||
|
||||
use Laravel\Facade;
|
||||
use Laravel\Container;
|
||||
|
||||
class Manager_Facade extends Facade { public static $resolve = 'cache'; }
|
||||
|
||||
class Manager {
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
<?php namespace Laravel\Database;
|
||||
|
||||
use Laravel\Facade;
|
||||
|
||||
class Manager_Facade extends Facade { public static $resolve = 'database'; }
|
||||
|
||||
class Manager {
|
||||
|
||||
/**
|
||||
|
|
|
@ -6,6 +6,10 @@ abstract class Facade {
|
|||
* Magic Method for passing methods to a class registered in the IoC container.
|
||||
* This provides a convenient method of accessing functions on classes that
|
||||
* could not otherwise be accessed staticly.
|
||||
*
|
||||
* Facades allow Laravel to still have a high level of dependency injection
|
||||
* and testability while still accomodating the common desire to conveniently
|
||||
* use classes via static methods.
|
||||
*/
|
||||
public static function __callStatic($method, $parameters)
|
||||
{
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
<?php namespace Laravel\Security;
|
||||
|
||||
use Laravel\IoC;
|
||||
use Laravel\Facade;
|
||||
use Laravel\Session\Driver;
|
||||
|
||||
class Authenticator_Facade extends Facade { public static $resolve = 'auth'; }
|
||||
|
||||
class Authenticator {
|
||||
|
||||
/**
|
||||
|
@ -51,16 +54,6 @@ public function __construct(Driver $driver, Hashing\Engine $hasher)
|
|||
$this->session = $driver;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an authenticator instance from the IoC container.
|
||||
*
|
||||
* @return Authenticator
|
||||
*/
|
||||
public static function make()
|
||||
{
|
||||
return IoC::container()->resolve('laravel.auth');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the current user of the application is authenticated.
|
||||
*
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
<?php namespace Laravel\Security;
|
||||
|
||||
use Laravel\IoC;
|
||||
use Laravel\Facade;
|
||||
|
||||
class Crypter_Facade extends Facade { public static $resolve = 'crypter'; }
|
||||
|
||||
class Crypter {
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
<?php namespace Laravel\Security\Hashing;
|
||||
|
||||
use Laravel\Facade;
|
||||
|
||||
class Hasher_Facade extends Facade { public static $resolve = 'hasher'; }
|
||||
|
||||
class Hasher {
|
||||
|
||||
/**
|
||||
|
@ -22,19 +26,6 @@ public function __construct(Engine $engine = null)
|
|||
$this->engine = (is_null($engine)) ? new BCrypt(10, false) : $engine;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new Hasher instance.
|
||||
*
|
||||
* If no hashing engine is provided, the BCrypt engine will be used.
|
||||
*
|
||||
* @param Engine $engine
|
||||
* @return Hasher
|
||||
*/
|
||||
public static function make(Engine $engine = null)
|
||||
{
|
||||
return new static($engine);
|
||||
}
|
||||
|
||||
/**
|
||||
* Magic Method for delegating method calls to the hashing engine.
|
||||
*
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
<?php namespace Laravel\Session;
|
||||
|
||||
use Laravel\Facade;
|
||||
use Laravel\Container;
|
||||
|
||||
class Manager_Facade extends Facade { public static $resolve = 'session'; }
|
||||
|
||||
class Manager {
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,7 +2,10 @@
|
|||
|
||||
use Laravel\IoC;
|
||||
use Laravel\Str;
|
||||
use Laravel\Lang;
|
||||
use Laravel\Facade;
|
||||
use Laravel\Lang_Factory;
|
||||
|
||||
class Validator_Facade extends Facade { public static $resolve = 'validator'; }
|
||||
|
||||
class Validator {
|
||||
|
||||
|
@ -68,24 +71,11 @@ class Validator {
|
|||
* @param Lang $lang
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Lang $lang)
|
||||
public function __construct(Lang_Factory $lang)
|
||||
{
|
||||
$this->lang = $lang;
|
||||
}
|
||||
|
||||
/**
|
||||
* Factory for creating new validator instances.
|
||||
*
|
||||
* @param array $attributes
|
||||
* @param array $rules
|
||||
* @param array $messages
|
||||
* @return Validator
|
||||
*/
|
||||
public static function make($attributes, $rules, $messages = array())
|
||||
{
|
||||
return IoC::resolve('laravel.validator')->of($attributes, $rules, $messages);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the attributes, rules, and messages for the validator.
|
||||
*
|
||||
|
@ -104,6 +94,8 @@ public function of($attributes, $rules, $messages = array())
|
|||
$this->attributes = $attributes;
|
||||
$this->messages = $messages;
|
||||
$this->rules = $rules;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue