src/Comodojo/Cache/Drivers/PhpRedis.php 1 location
|
@@ 151-163 (lines=13) @@
|
| 148 |
|
|
| 149 |
|
try { |
| 150 |
|
|
| 151 |
|
if ( $namespace == null ) { |
| 152 |
|
|
| 153 |
|
return (bool) $this->getInstance()->flushDB(); |
| 154 |
|
|
| 155 |
|
} else { |
| 156 |
|
|
| 157 |
|
$scope = $this->getNamespaceKey($namespace); |
| 158 |
|
|
| 159 |
|
if ( $scope === false ) return false; |
| 160 |
|
|
| 161 |
|
return (bool) $this->getInstance()->delete($namespace); |
| 162 |
|
|
| 163 |
|
} |
| 164 |
|
|
| 165 |
|
} catch (RedisException $re) { |
| 166 |
|
|
src/Comodojo/Cache/Drivers/Memcached.php 1 location
|
@@ 107-119 (lines=13) @@
|
| 104 |
|
|
| 105 |
|
public function clear($namespace = null) { |
| 106 |
|
|
| 107 |
|
if ( $namespace == null ) { |
| 108 |
|
|
| 109 |
|
return $this->getInstance()->flush(); |
| 110 |
|
|
| 111 |
|
} else { |
| 112 |
|
|
| 113 |
|
$scope = $this->getNamespaceKey($namespace); |
| 114 |
|
|
| 115 |
|
if ( $scope === false ) return false; |
| 116 |
|
|
| 117 |
|
return $this->getInstance()->delete($namespace); |
| 118 |
|
|
| 119 |
|
} |
| 120 |
|
|
| 121 |
|
} |
| 122 |
|
|