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

@@ -35,13 +35,13 @@ class Cache {
switch ($driver)
{
case 'file':
return static::$drivers[$driver] = new Cache\File;
return static::$drivers[$driver] = IoC::container()->resolve('laravel.cache.file');
case 'memcached':
return static::$drivers[$driver] = new Cache\Memcached;
return static::$drivers[$driver] = IoC::container()->resolve('laravel.cache.memcached');
case 'apc':
return static::$drivers[$driver] = new Cache\APC;
return static::$drivers[$driver] = IoC::container()->resolve('laravel.cache.apc');
default:
throw new \Exception("Cache driver [$driver] is not supported.");