示例#1
0
 /**
  * {@inheritdoc}
  */
 public function storeContents($directory, array $contents, $recursive)
 {
     if ($recursive) {
         return $contents;
     }
     foreach ($contents as $index => $object) {
         $pathinfo = Util::pathinfo($object['path']);
         $object = array_merge($pathinfo, $object);
         if (!$recursive && $object['dirname'] !== $directory) {
             unset($contents[$index]);
             continue;
         }
         $contents[$index] = $object;
     }
     return $contents;
 }
示例#2
0
 /**
  * Ensure parent directories of an object
  *
  * @param   string  $path  object path
  */
 public function ensureParentDirectories($path)
 {
     $object = $this->cache[$path];
     while ($object['dirname'] !== '' && !isset($this->cache[$object['dirname']])) {
         $object = Util::pathinfo($object['dirname']);
         $object['type'] = 'dir';
         $this->cache[$object['path']] = $object;
     }
 }