Files
ponzi/system/cache/factory.php
Bartosz Romanowski b031fdf43d APC cache driver
2011-06-18 23:01:52 +02:00

29 lines
443 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;
case 'apc':
return new Driver\APC;
default:
throw new \Exception("Cache driver [$driver] is not supported.");
}
}
}