當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ssh2_sftp_rmdir函數代碼示例

本文整理匯總了PHP中ssh2_sftp_rmdir函數的典型用法代碼示例。如果您正苦於以下問題:PHP ssh2_sftp_rmdir函數的具體用法?PHP ssh2_sftp_rmdir怎麽用?PHP ssh2_sftp_rmdir使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了ssh2_sftp_rmdir函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: delete

 /**
  * @param $filename
  */
 public function delete($filename)
 {
     if ($this->isDir($filename)) {
         ssh2_sftp_rmdir($this->getSftpResource(), $filename);
     } else {
         ssh2_sftp_unlink($this->getSftpResource(), $filename);
     }
 }
開發者ID:brabijan,項目名稱:ssh,代碼行數:11,代碼來源:RemoteFilesystem.php

示例2: remove

 public function remove($remote)
 {
     $sftp = ssh2_sftp($this->conn_);
     $rc = false;
     if (is_dir("ssh2.sftp://{$sftp}/{$remote}")) {
         $rc = ssh2_sftp_rmdir($sftp, $remote);
     } else {
         $rc = ssh2_sftp_unlink($sftp, $remote);
     }
     return $rc;
 }
開發者ID:nicevoice,項目名稱:yhtx,代碼行數:11,代碼來源:Sftp.php

示例3: delete

 public function delete($file, $recursive = false)
 {
     if ($this->is_file($file)) {
         return ssh2_sftp_unlink($this->sftp, $file);
     }
     if (!$recursive) {
         return ssh2_sftp_rmdir($this->sftp, $file);
     }
     $filelist = $this->getdir($file);
     if (is_array($filelist)) {
         foreach ($filelist as $filename => $fileinfo) {
             $this->delete($file . '/' . $filename, $recursive);
         }
     }
     return ssh2_sftp_rmdir($this->sftp, $file);
 }
開發者ID:laiello,項目名稱:litepublisher,代碼行數:16,代碼來源:remote.ssh2.class.php

示例4: _removeDir_real

 /**
  * Remove Directory
  *
  * @param string $path Path to remove
  * @return Object
  */
 function _removeDir_real($path)
 {
     if (substr($path, 0, 2) == "./") {
         $path = substr($path, 2);
     }
     $target_path = $this->ftp_info->ftp_root_path . $path;
     if (!@ssh2_sftp_rmdir($this->sftp, $target_path)) {
         return new Object(-1, sprintf(Context::getLang('msg_delete_dir_failed'), $path));
     }
     return new Object();
 }
開發者ID:Gunmania,項目名稱:xe-core,代碼行數:17,代碼來源:autoinstall.lib.php

示例5: rmdir

 /**
  * @{inheritDoc}
  */
 public function rmdir($dirname = '')
 {
     return $this->doRun(__METHOD__, func_get_args(), ssh2_sftp_rmdir($this->sftp, $dirname));
 }
開發者ID:eroluysal,項目名稱:shunt,代碼行數:7,代碼來源:SFTP.php

示例6: rmdir

 public function rmdir($directory)
 {
     $check = '/' . trim($this->dir, '/') . '/' . trim($directory, '/');
     return @ssh2_sftp_rmdir($this->handle, $check);
 }
開發者ID:adjaika,項目名稱:J3Base,代碼行數:5,代碼來源:restore.php

示例7: delete

 /**
  * Deletes a remote file.
  *
  * @param string  $remote_path
  * @param boolean $recursive
  *
  * @return boolean Returns TRUE on success or FALSE on error
  *
  * @throws \BackBee\Util\Transport\Exception\TransportException Occures if SSH connection is invalid
  */
 public function delete($remote_path, $recursive = false)
 {
     if (null === $this->_sftp_resource) {
         throw new TransportException(sprintf('None SSH connection available.'));
     }
     if (true === $recursive) {
         // @todo
         throw new TransportException(sprintf('REcursive option not implemented yet.'));
     }
     $remote_path = $this->_getAbsoluteRemotePath($remote_path);
     if (false === @ssh2_sftp_stat($this->_sftp_resource, $remote_path)) {
         return $this->_trigger_error(sprintf('Remote file to delete does not exist: %s.', $remote_path));
     }
     if (false === ssh2_sftp_unlink($this->_sftp_resource, $remote_path)) {
         return ssh2_sftp_rmdir($this->_sftp_resource, $remote_path);
     }
     return true;
 }
開發者ID:mickaelsteinberg,項目名稱:BackBee,代碼行數:28,代碼來源:SFTP.php

示例8: delete

 /**
  * @param string $identifier
  * @param bool $recursive
  * @return bool
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function delete($identifier, $recursive)
 {
     if (is_dir($this->sftpWrapper . $identifier)) {
         return ssh2_sftp_rmdir($this->sftp, $identifier);
     } elseif (is_file($this->sftpWrapper . $identifier)) {
         return ssh2_sftp_unlink($this->sftp, $identifier);
     } else {
         return false;
     }
 }
開發者ID:vertexvaar,項目名稱:falsftp,代碼行數:16,代碼來源:PhpSshAdapter.php

示例9: delete_dir

 /**
  * Delete a folder and recursively delete everything (including sub-folders)
  * containted within it.
  *
  * @access	public
  * @param	string
  * @return	bool
  */
 function delete_dir($filepath)
 {
     if (!$this->_is_conn()) {
         return FALSE;
     }
     // Add a trailing slash to the file path if needed
     $filepath = preg_replace("/(.+?)\\/*\$/", "\\1/", $filepath);
     $result = @ssh2_sftp_rmdir($this->conn_id, $filepath);
     if ($result === FALSE) {
         $this->_error('sftp_unable_to_delete');
         return FALSE;
     }
     return TRUE;
 }
開發者ID:mefisto2009,項目名稱:GameAP,代碼行數:22,代碼來源:Files_sftp.php

示例10: ssh2RemoveDirectory

 function ssh2RemoveDirectory($directory)
 {
     $result = ssh2_sftp_rmdir($this->sftp, $directory);
     return $result;
 }
開發者ID:blasiuscosa,項目名稱:manobo-2008,代碼行數:5,代碼來源:ssh.php

示例11: delete

 /**
  * Deletes an item on the SFTP server
  *
  * @author Art <a.molcanovas@gmail.com>
  *
  * @param string $item File or directory name
  *
  * @return boolean
  */
 function delete($item)
 {
     $this->checkSubsystem();
     $path = $this->resolvePath($item);
     if (self::isFile($item)) {
         $success = ssh2_sftp_unlink($this->sftp, $path);
     } else {
         $success = ssh2_sftp_rmdir($this->sftp, $path);
     }
     if ($success) {
         \Log::debug('Deleted ' . $item);
         return true;
     } else {
         \Log::error('Failed to delete ' . $item);
         return false;
     }
 }
開發者ID:alorel,項目名稱:alo-framework,代碼行數:26,代碼來源:sftp.php

示例12: deleteDir

 /**
  * [deleteDir description]
  * @param  [type] $path [description]
  * @return [type]       [description]
  */
 public function deleteDir($path)
 {
     if (false === $this->validConn()) {
         throw new Exception('invalid connection');
     }
     if (!($this->sftp = @ssh2_sftp($this->conn))) {
         throw new Exception("unable to establish sftp connection with {$host}");
     }
     return $this->sftp;
     // Add a trailing slash to the file path if needed
     $filepath = preg_replace("/(.+?)\\/*\$/", "\\1/", $path);
     $list = $this->fileList($path);
     if (count($list) > 0) {
         foreach ($list as $item) {
             if (!@ssh2_sftp_rmdir($this->sftp, $item)) {
                 $this->deleteDir($item);
             }
         }
     }
     return true;
 }
開發者ID:NaszvadiG,項目名稱:sftp,代碼行數:26,代碼來源:SFTP.php

示例13: doDelDir

 /** 
  * Delete a directory and return true/false according to success.
  * Wrapping ssh2_exec
  * 
  * (non-PHPdoc)
  * @see kFileTransferMgr::doDelDir()
  */
 protected function doDelDir($remotePath)
 {
     return ssh2_sftp_rmdir($this->getSftpConnection(), $remotePath);
 }
開發者ID:dozernz,項目名稱:server,代碼行數:11,代碼來源:sftpMgr.class.php

示例14: rmdir

 public function rmdir($dirname)
 {
     return ssh2_sftp_rmdir($this->_sftp, $dirname);
 }
開發者ID:unionbt,項目名稱:hanpaimall,代碼行數:4,代碼來源:SSH.php

示例15: rmdir

 /**
  * Removes a directory
  *
  * @param  string $dirname The directory that is being removed
  *
  * @return Boolean TRUE on success, or FALSE on failure
  */
 public function rmdir($dirname)
 {
     return ssh2_sftp_rmdir($this->getResource(), $dirname);
 }
開發者ID:jimigrunge,項目名稱:php-ssh,代碼行數:11,代碼來源:Sftp.php


注:本文中的ssh2_sftp_rmdir函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。