Cachearium\CacheAbstract::end PHP Method

end() public method

Ends the cache start().
See also: recursiveEnd()
public end ( $print = true )
    public function end($print = true)
    {
        return $this->recursiveEnd($print);
    }

Usage Example

 private function _startNested(CacheAbstract $cache)
 {
     $expected = ["first level", "second level 1", "second level 2", "second level 3"];
     $i = 0;
     $data = '';
     if (!($data = $cache->start(new CacheKey('startnested', 'first', 0), null, false))) {
         $this->assertTrue(true);
         echo $expected[$i++];
         if (!$cache->start(new CacheKey('startnested', 'second', $i), null, false)) {
             echo $expected[$i++];
             if (!$cache->start(new CacheKey('startnested', 'second', $i), null, false)) {
                 echo $expected[$i++];
                 if (!$cache->start(new CacheKey('startnested', 'second', $i), null, false)) {
                     echo $expected[$i++];
                     $cache->end();
                 }
                 $cache->end();
             }
             $cache->end();
         }
         $data = $cache->end(false);
     } else {
         $this->assertTrue(false);
     }
     $this->assertEquals(implode('', $expected), $data);
 }
All Usage Examples Of Cachearium\CacheAbstract::end