コード例 #1
0
 public function testDelAfterStat()
 {
     $name = 'foo.txt';
     $txtFile = $this->getTextFile();
     $this->share->put($txtFile, $this->root . '/' . $name);
     unlink($txtFile);
     $this->share->stat($this->root . '/' . $name);
     $this->share->del($this->root . '/foo.txt');
 }
コード例 #2
0
 /**
  * Delete the contents of a directory.
  *
  * @param string $path
  */
 protected function deleteContents($path)
 {
     $contents = $this->listContents($path, true) ?: array();
     foreach (array_reverse($contents) as $object) {
         $fullPath = $this->applyPathPrefix($object['path']);
         if ($object['type'] === 'dir') {
             $this->share->rmdir($fullPath);
         } else {
             $this->share->del($fullPath);
         }
     }
 }