continued refactoring.
This commit is contained in:
2
laravel/cache/manager.php
vendored
2
laravel/cache/manager.php
vendored
@@ -52,7 +52,7 @@ class Manager {
|
|||||||
|
|
||||||
if ( ! array_key_exists($driver, $this->drivers))
|
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.");
|
throw new \Exception("Cache driver [$driver] is not supported.");
|
||||||
}
|
}
|
||||||
|
|||||||
3
laravel/cache/memcached.php
vendored
3
laravel/cache/memcached.php
vendored
@@ -1,6 +1,5 @@
|
|||||||
<?php namespace Laravel\Cache;
|
<?php namespace Laravel\Cache;
|
||||||
|
|
||||||
use Memcache;
|
|
||||||
use Laravel\Config;
|
use Laravel\Config;
|
||||||
|
|
||||||
class Memcached extends Driver {
|
class Memcached extends Driver {
|
||||||
@@ -25,7 +24,7 @@ class Memcached extends Driver {
|
|||||||
* @param Memcache $memcache
|
* @param Memcache $memcache
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function __construct(Memcache $memcache, $key)
|
public function __construct(\Memcache $memcache, $key)
|
||||||
{
|
{
|
||||||
$this->key = $key;
|
$this->key = $key;
|
||||||
$this->memcache = $memcache;
|
$this->memcache = $memcache;
|
||||||
|
|||||||
@@ -9,13 +9,6 @@ class Request {
|
|||||||
*/
|
*/
|
||||||
public $server;
|
public $server;
|
||||||
|
|
||||||
/**
|
|
||||||
* The $_POST array for the request.
|
|
||||||
*
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
private $post;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The route handling the current request.
|
* The route handling the current request.
|
||||||
*
|
*
|
||||||
@@ -23,6 +16,13 @@ class Request {
|
|||||||
*/
|
*/
|
||||||
public $route;
|
public $route;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The $_POST array for the request.
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
private $post;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base URL of the application.
|
* The base URL of the application.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -155,34 +155,6 @@ class Response {
|
|||||||
$this->status = $status;
|
$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.
|
* Get the evaluated string contents of the response.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ class APC extends Driver {
|
|||||||
* Create a new APC session driver instance.
|
* Create a new APC session driver instance.
|
||||||
*
|
*
|
||||||
* @param Cache\APC $apc
|
* @param Cache\APC $apc
|
||||||
|
* @param int $lifetime
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function __construct(\Laravel\Cache\APC $apc, $lifetime)
|
public function __construct(\Laravel\Cache\APC $apc, $lifetime)
|
||||||
|
|||||||
@@ -34,12 +34,12 @@ class Manager {
|
|||||||
*/
|
*/
|
||||||
public function driver($driver)
|
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 @@ class View_Factory {
|
|||||||
$this->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.
|
* Create a new view instance from a view name.
|
||||||
*
|
*
|
||||||
@@ -212,18 +200,6 @@ class View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 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.
|
* Get the evaluated string content of the view.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user