continued refactoring.
This commit is contained in:
parent
61eced25a1
commit
30514d9020
|
@ -52,7 +52,7 @@ public function driver($driver = null)
|
|||
|
||||
if ( ! array_key_exists($driver, $this->drivers))
|
||||
{
|
||||
if ( ! in_array($driver, array('apc', 'file', 'memcached')))
|
||||
if ( ! $this->container->registered('laravel.cache.'.$driver))
|
||||
{
|
||||
throw new \Exception("Cache driver [$driver] is not supported.");
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<?php namespace Laravel\Cache;
|
||||
|
||||
use Memcache;
|
||||
use Laravel\Config;
|
||||
|
||||
class Memcached extends Driver {
|
||||
|
@ -25,7 +24,7 @@ class Memcached extends Driver {
|
|||
* @param Memcache $memcache
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Memcache $memcache, $key)
|
||||
public function __construct(\Memcache $memcache, $key)
|
||||
{
|
||||
$this->key = $key;
|
||||
$this->memcache = $memcache;
|
||||
|
|
|
@ -9,13 +9,6 @@ class Request {
|
|||
*/
|
||||
public $server;
|
||||
|
||||
/**
|
||||
* The $_POST array for the request.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $post;
|
||||
|
||||
/**
|
||||
* The route handling the current request.
|
||||
*
|
||||
|
@ -23,6 +16,13 @@ class Request {
|
|||
*/
|
||||
public $route;
|
||||
|
||||
/**
|
||||
* The $_POST array for the request.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $post;
|
||||
|
||||
/**
|
||||
* The base URL of the application.
|
||||
*
|
||||
|
|
|
@ -155,34 +155,6 @@ public function __construct($content, $status = 200, $headers = array())
|
|||
$this->status = $status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new response instance.
|
||||
*
|
||||
* @param mixed $content
|
||||
* @param int $status
|
||||
* @return Response
|
||||
*/
|
||||
public static function make($content, $status = 200)
|
||||
{
|
||||
return IoC::container()->resolve('laravel.response')->make($content, $status);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new error response instance.
|
||||
*
|
||||
* The response status code will be set using the specified code.
|
||||
*
|
||||
* Note: The specified error code should correspond to a view in your views/error directory.
|
||||
*
|
||||
* @param int $code
|
||||
* @param array $data
|
||||
* @return Response
|
||||
*/
|
||||
public static function error($code, $data = array())
|
||||
{
|
||||
return IoC::container()->resolve('laravel.response')->error($code, $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the evaluated string contents of the response.
|
||||
*
|
||||
|
|
|
@ -20,6 +20,7 @@ class APC extends Driver {
|
|||
* Create a new APC session driver instance.
|
||||
*
|
||||
* @param Cache\APC $apc
|
||||
* @param int $lifetime
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(\Laravel\Cache\APC $apc, $lifetime)
|
||||
|
|
|
@ -34,12 +34,12 @@ public function __construct(Container $container)
|
|||
*/
|
||||
public function driver($driver)
|
||||
{
|
||||
if (in_array($driver, array('cookie', 'file', 'database', 'apc', 'memcached')))
|
||||
if ( ! $this->container->registered('laravel.session.'.$driver))
|
||||
{
|
||||
return $this->container->resolve('laravel.session.'.$driver);
|
||||
throw new \Exception("Session driver [$driver] is not supported.");
|
||||
}
|
||||
|
||||
throw new \Exception("Session driver [$driver] is not supported.");
|
||||
return $this->container->resolve('laravel.session.'.$driver);
|
||||
}
|
||||
|
||||
}
|
|
@ -93,18 +93,6 @@ public function __construct($path, View_Composer $composer)
|
|||
$this->composer = $composer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new view instance.
|
||||
*
|
||||
* @param string $view
|
||||
* @param array $data
|
||||
* @return View
|
||||
*/
|
||||
public function make($view, $data = array())
|
||||
{
|
||||
return new View($view, $data, $this->path($view), $this->composer, $this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new view instance from a view name.
|
||||
*
|
||||
|
@ -212,18 +200,6 @@ public function __construct($view, $data, $path, View_Composer $composer, View_F
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new view instance.
|
||||
*
|
||||
* @param string $view
|
||||
* @param array $data
|
||||
* @return View
|
||||
*/
|
||||
public static function make($view, $data = array())
|
||||
{
|
||||
return IoC::container()->resolve('laravel.view')->make($view, $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the evaluated string content of the view.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue