mirror of
https://github.com/laravel/laravel.git
synced 2025-02-20 11:53:14 +08:00
26 lines
400 B
PHP
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.");
|
|
}
|
|
}
|
|
|
|
} |