Stash\Pool::purge PHP Method

purge() public method

public purge ( )
    public function purge()
    {
        if ($this->isDisabled) {
            return false;
        }
        try {
            $results = $this->getDriver()->purge();
        } catch (\Exception $e) {
            $this->isDisabled = true;
            $this->logException('Purging Cache Pool caused exception.', $e);
            return false;
        }
        return $results;
    }

Usage Example

コード例 #1
0
 public function testPurge()
 {
     $pool = new Pool();
     $pool->setDriver(new DriverExceptionStub());
     $item = $pool->getItem('test');
     $this->assertFalse($item->isDisabled());
     $this->assertFalse($pool->purge());
     $item = $pool->getItem('test');
     $this->assertTrue($item->isDisabled(), 'Is disabled after exception is thrown in driver');
     $this->assertFalse($pool->purge());
 }
All Usage Examples Of Stash\Pool::purge