laravel/system/cache/factory.php
2011-06-08 23:45:08 -05:00

26 lines
400 B
PHP

<?php namespace System\Cache;
class Factory {
/**
* Create a cache driver instance.
*
* @param string $driver
* @return Driver
*/
public static function make($driver)
{
switch ($driver)
{
case 'file':
return new Driver\File;
case 'memcached':
return new Driver\Memcached;
default:
throw new \Exception("Cache driver [$driver] is not supported.");
}
}
}