Esempio n. 1
0
File: smb.php Progetto: evanjt/core
 public function rmdir($path)
 {
     try {
         $this->statCache = array();
         $content = $this->share->dir($this->buildPath($path));
         foreach ($content as $file) {
             if ($file->isDirectory()) {
                 $this->rmdir($path . '/' . $file->getName());
             } else {
                 $this->share->del($file->getPath());
             }
         }
         $this->share->rmdir($this->buildPath($path));
         return true;
     } catch (NotFoundException $e) {
         return false;
     }
 }
Esempio n. 2
0
 public function rmdir($path)
 {
     try {
         $this->statCache = array();
         $content = $this->share->dir($this->buildPath($path));
         foreach ($content as $file) {
             if ($file->isDirectory()) {
                 $this->rmdir($path . '/' . $file->getName());
             } else {
                 $this->share->del($file->getPath());
             }
         }
         $this->share->rmdir($this->buildPath($path));
         return true;
     } catch (NotFoundException $e) {
         return false;
     } catch (ForbiddenException $e) {
         return false;
     } catch (ConnectException $e) {
         throw new StorageNotAvailableException($e->getMessage(), $e->getCode(), $e);
     }
 }