48 lines
1.2 KiB
PHP
48 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace alveolata\cache;
|
|
|
|
// require_once(DIR_ALVEOLATA . '/definitions.php');
|
|
require_once(DIR_ALVEOLATA . '/cache/implementation-apc/functions.php');
|
|
require_once(DIR_ALVEOLATA . '/cache/abstract/interface.php');
|
|
|
|
|
|
/**
|
|
* @author Christian Fraß <frass@greenscale.de>
|
|
*/
|
|
class implementation_apc implements interface_cache
|
|
{
|
|
|
|
/**
|
|
* @var struct_subject_apc $subject
|
|
* @author Christian Fraß <frass@greenscale.de>
|
|
*/
|
|
private $subject;
|
|
|
|
|
|
/**
|
|
* @author Christian Fraß <frass@greenscale.de>
|
|
*/
|
|
private function __construct(struct_subject_apc $subject) {$this->subject = $subject;}
|
|
|
|
|
|
/**
|
|
* @param string $section
|
|
* @return implementation_apc
|
|
* @author Christian Fraß <frass@greenscale.de>
|
|
*/
|
|
public static function make(string $section = UNSET_STRING) : implementation_apc {return (new static(apc_make($section)));}
|
|
|
|
|
|
/**
|
|
* @implementations
|
|
*
|
|
* @author Christian Fraß <frass@greenscale.de>
|
|
*/
|
|
public function set(string $id, $value) : void {apc_set($this->subject, $id, $value);}
|
|
public function has(string $id) : bool {return apc_has($this->subject, $id);}
|
|
public function fetch(string $id) {return apc_fetch($this->subject, $id);}
|
|
public function clear() : void {apc_clear($this->subject);}
|
|
|
|
}
|
|
|