コード例 #1
0
ファイル: SftpHelper.php プロジェクト: giovdk21/deployii
 /**
  * @param string $path
  *
  * @return bool
  */
 public function isFile($path)
 {
     $res = $this->_getFromCache(__FUNCTION__, $path);
     if ($res === null) {
         switch ($this->_connType) {
             case SftpHelper::TYPE_SFTP:
             default:
                 $res = $this->_connection->is_file($path);
                 break;
             case SftpHelper::TYPE_FTP:
                 $res = is_file($this->_getStreamUrl($path));
                 break;
         }
         $this->_addToCache(__FUNCTION__, $path, $res);
         if ($res) {
             $this->_addToCache('fileExists', $path, true);
         }
         Log::logger()->addDebug('Performing ' . __METHOD__ . ' // result: {res}', ['res' => $res, 'path' => $path]);
     }
     return $res;
 }