コード例 #1
0
ファイル: FtpClient.php プロジェクト: nicolab/php-ftp-client
 /**
  * Remove a file or a directory.
  * 
  * @see FtpClient::rmdir()
  * @see FtpClient::cleanDir()
  * @see FtpClient::delete()
  * @param  string $path      The path of the file or directory to remove
  * @param  bool   $recursive Is effective only if $path is a directory, {@see FtpClient::rmdir()}
  * @return bool
  */
 public function remove($path, $recursive = false)
 {
     try {
         if (@$this->ftp->delete($path) or $this->isDir($path) and @$this->rmdir($path, $recursive)) {
             return true;
         }
         return false;
     } catch (\Exception $e) {
         return false;
     }
 }