Commit 30514d90 authored by Taylor Otwell's avatar Taylor Otwell

continued refactoring.

parent 61eced25
......@@ -52,7 +52,7 @@ class Manager {
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.");
}
......
<?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;
......
......@@ -10,18 +10,18 @@ class Request {
public $server;
/**
* The $_POST array for the request.
* The route handling the current request.
*
* @var array
* @var Routing\Route
*/
private $post;
public $route;
/**
* The route handling the current request.
* The $_POST array for the request.
*
* @var Routing\Route
* @var array
*/
public $route;
private $post;
/**
* The base URL of the application.
......
......@@ -155,34 +155,6 @@ class Response {
$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 @@ class Manager {
*/
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);
}
}
\ No newline at end of file
......@@ -93,18 +93,6 @@ class View_Factory {
$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 @@ 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.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment