| @@ 612-632 (lines=21) @@ | ||
| 609 | * |
|
| 610 | * @return bool |
|
| 611 | */ |
|
| 612 | public function removeItem($key) |
|
| 613 | { |
|
| 614 | if ($this->adapter instanceof iAdapter) { |
|
| 615 | $storeKey = $this->calculateStoreKey($key); |
|
| 616 | ||
| 617 | if (!empty(self::$STATIC_CACHE)) { |
|
| 618 | ||
| 619 | // remove static-cache |
|
| 620 | if (array_key_exists($storeKey, self::$STATIC_CACHE) === true) { |
|
| 621 | unset( |
|
| 622 | self::$STATIC_CACHE[$storeKey], |
|
| 623 | self::$STATIC_CACHE_COUNTER[$storeKey] |
|
| 624 | ); |
|
| 625 | } |
|
| 626 | } |
|
| 627 | ||
| 628 | return $this->adapter->remove($storeKey); |
|
| 629 | } else { |
|
| 630 | return false; |
|
| 631 | } |
|
| 632 | } |
|
| 633 | ||
| 634 | /** |
|
| 635 | * Remove all cached-items. |
|
| @@ 663-684 (lines=22) @@ | ||
| 660 | * |
|
| 661 | * @return boolean |
|
| 662 | */ |
|
| 663 | public function existsItem($key) |
|
| 664 | { |
|
| 665 | if ($this->adapter instanceof iAdapter) { |
|
| 666 | $storeKey = $this->calculateStoreKey($key); |
|
| 667 | ||
| 668 | if (!empty(self::$STATIC_CACHE)) { |
|
| 669 | ||
| 670 | if (!isset(self::$STATIC_CACHE_COUNTER[$storeKey])) { |
|
| 671 | self::$STATIC_CACHE_COUNTER[$storeKey] = 0; |
|
| 672 | } |
|
| 673 | ||
| 674 | // get from static-cache |
|
| 675 | if (array_key_exists($storeKey, self::$STATIC_CACHE) === true) { |
|
| 676 | return true; |
|
| 677 | } |
|
| 678 | } |
|
| 679 | ||
| 680 | return $this->adapter->exists($storeKey); |
|
| 681 | } else { |
|
| 682 | return false; |
|
| 683 | } |
|
| 684 | } |
|
| 685 | ||
| 686 | /** |
|
| 687 | * Get the current adapter class-name. |
|