Refactored structure
This commit is contained in:
parent
963225382c
commit
e5164ae1dd
329 changed files with 277 additions and 457 deletions
29
src/B8Framework/Cache.php
Executable file
29
src/B8Framework/Cache.php
Executable file
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
namespace b8;
|
||||
|
||||
/**
|
||||
* @package b8
|
||||
* @subpackage Cache
|
||||
*/
|
||||
|
||||
class Cache
|
||||
{
|
||||
const TYPE_APC = 'ApcCache';
|
||||
const TYPE_REQUEST = 'RequestCache';
|
||||
|
||||
protected static $instance = array();
|
||||
|
||||
/**
|
||||
* Get a cache object of a specified type.
|
||||
*/
|
||||
public static function getCache($type = self::TYPE_REQUEST)
|
||||
{
|
||||
if (!isset(self::$instance[$type])) {
|
||||
$class = '\\b8\\Cache\\' . $type;
|
||||
self::$instance[$type] = new $class();
|
||||
}
|
||||
|
||||
return self::$instance[$type];
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue