當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。