当前位置: 首页>>代码示例>>PHP>>正文


PHP resource::pwd方法代码示例

本文整理汇总了PHP中resource::pwd方法的典型用法代码示例。如果您正苦于以下问题:PHP resource::pwd方法的具体用法?PHP resource::pwd怎么用?PHP resource::pwd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在resource的用法示例。


在下文中一共展示了resource::pwd方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: pwd

 /**
  * Shows you the actual path on the server
  *
  * @access  public
  * @return  mixed        The actual path or Jaws_Error
  */
 function pwd()
 {
     $res = $this->_ftp->pwd();
     if (PEAR::isError($res)) {
         return new Jaws_Error($res->getMessage(), __FUNCTION__);
     }
     return $res;
 }
开发者ID:uda,项目名称:jaws,代码行数:14,代码来源:FTP.php

示例2: pwd

 /**
  * Returns the current directory path
  *
  * @return string
  */
 public function pwd()
 {
     switch ($this->_connType) {
         case SftpHelper::TYPE_SFTP:
         default:
             $res = $this->_connection->pwd();
             break;
         case SftpHelper::TYPE_FTP:
             $res = ftp_pwd($this->_connection);
             break;
     }
     return $res;
 }
开发者ID:giovdk21,项目名称:deployii,代码行数:18,代码来源:SftpHelper.php

示例3: purge

 /**
  * Purge given directory's contents
  *
  * @var string $purgeDirs
  */
 public function purge($purgeDirs)
 {
     foreach ($purgeDirs as $dir) {
         $origin = $this->connection->pwd();
         $this->output("<red>Purging directory <white>{$dir}");
         // Failing to enter into the directory means should stop
         // the script form purging. Otherwise wrong content is deleted.
         // @Agnis-LV lost ~8GB of important data because of this. Sorry man!
         if (!$this->connection->cd($dir)) {
             $this->output(" ! Could not enter into '{$dir}'. Check your directory path.");
             $this->connection->cd($origin);
             continue;
         }
         if (!($tmpFiles = $this->connection->ls())) {
             $this->output(" - Nothing to purge in {$dir}");
             $this->connection->cd($origin);
             continue;
         }
         $haveFiles = false;
         $innerDirs = array();
         foreach ($tmpFiles as $file) {
             $curr = $this->connection->pwd();
             if ($this->connection->cd($file)) {
                 $innerDirs[] = $file;
                 $this->connection->cd($curr);
             } else {
                 $haveFiles = true;
                 $this->output(" - {$file} is removed from directory");
                 $this->connection->rm($file);
             }
         }
         if (!$haveFiles) {
             $this->output(" - Nothing to purge in {$dir}");
         } else {
             $this->output("<red>Purged <white>{$dir}");
         }
         if (count($innerDirs) > 0) {
             // Recursive purging
             $this->purge($innerDirs);
         }
         $this->connection->cd($origin);
     }
 }
开发者ID:baoweber,项目名称:PHPloy,代码行数:48,代码来源:PHPloy.php

示例4: purge

 /**
  * Purge given directory's contents
  *
  * @var string $purgeDirs
  */
 public function purge($purgeDirs)
 {
     foreach ($purgeDirs as $dir) {
         $origin = $this->connection->pwd();
         $this->connection->cd($dir);
         $this->output("<red>Purging directory <white>{$dir}");
         if (!($tmpFiles = $this->connection->ls())) {
             $this->output(" - Nothing to purge in {$dir}");
             $this->connection->cd($origin);
             continue;
         }
         $haveFiles = false;
         $innerDirs = [];
         foreach ($tmpFiles as $file) {
             $curr = $this->connection->pwd();
             if ($this->connection->cd($file)) {
                 $innerDirs[] = $file;
                 $this->connection->cd($curr);
             } else {
                 $haveFiles = true;
                 $this->output(" - {$file} is removed from directory");
                 $this->connection->rm($file);
             }
         }
         if (!$haveFiles) {
             $this->output(" - Nothing to purge in {$dir}");
         } else {
             $this->output("<red>Purged <white>{$dir}");
         }
         if (count($innerDirs) > 0) {
             $this->purge($innerDirs);
         }
         $this->connection->cd($origin);
     }
 }
开发者ID:peterbrinck,项目名称:PHPloy,代码行数:40,代码来源:PHPloy.php

示例5: purge

 /**
  * Purge given directory's contents
  *
  * @var string $purgeDirs
  */
 public function purge($purgeDirs)
 {
     foreach ($purgeDirs as $dir) {
         $origin = $this->connection->pwd();
         $this->connection->cd($dir);
         if (!($tmpFiles = $this->connection->ls())) {
             $this->output("Nothing to purge in {$dir}");
             continue;
         }
         $this->output("<red>Purging <white> ...");
         foreach ($tmpFiles as $file) {
             $this->connection->rm($file);
         }
         $this->output("<red>Purged <white>{$dir}");
         $this->connection->cd($origin);
     }
 }
开发者ID:GaryJones,项目名称:PHPloy,代码行数:22,代码来源:PHPloy.php


注:本文中的resource::pwd方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。