Files
nl-admin-api/system/cache/factory.php

29 lines
443 B
PHP
Raw Normal View History

2011-06-08 23:45:08 -05:00
<?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;
2011-06-18 23:01:52 +02:00
case 'apc':
return new Driver\APC;
2011-06-08 23:45:08 -05:00
default:
throw new \Exception("Cache driver [$driver] is not supported.");
}
}
}