Beispiel #1
0
 /**
  * Check whether a path exists
  *
  * @param  string  $path path to check
  * @return boolean whether the path exists
  */
 public function has($path)
 {
     $path = Util::normalizePath($path);
     if (($exists = $this->cache->has($path)) !== null) {
         return $exists;
     }
     $result = $this->adapter->has($path);
     if (!$result) {
         $this->cache->storeMiss($path);
         return false;
     }
     $this->cache->updateObject($path, $result === true ? array() : $result, true);
     return true;
 }
Beispiel #2
0
 /**
  * {@inheritdoc}
  */
 public function has($path)
 {
     $path = Util::normalizePath($path);
     $exists = $this->cache->has($path);
     if (is_bool($exists)) {
         return $exists;
     }
     $result = $this->adapter->has($path);
     if (!$result) {
         $this->cache->storeMiss($path);
         return false;
     }
     $object = is_array($result) ? $result : compact('path');
     $this->cache->updateObject($path, $object, true);
     return true;
 }