当前位置: 首页>>代码示例>>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;未经允许,请勿转载。