Pop\Cache\Cache::factory PHP 메소드

factory() 공개 정적인 메소드

Static method to instantiate the cache object and return itself to facilitate chaining methods together.
public static factory ( Pop\Cache\Adapter\AdapterInterface $adapter, integer $lifetime ) : Cache
$adapter Pop\Cache\Adapter\AdapterInterface
$lifetime integer
리턴 Cache
    public static function factory(Adapter\AdapterInterface $adapter, $lifetime = 0)
    {
        return new self($adapter, $lifetime);
    }

Usage Example

예제 #1
0
 public function testGetVersion()
 {
     if (class_exists('Memcache')) {
         $c = Cache::factory(new Memcached(), 30);
         $this->assertNotNull($c->adapter()->getVersion());
     }
 }
All Usage Examples Of Pop\Cache\Cache::factory