/** * @param string $path * * @return bool */ public function fileExists($path) { $res = $this->_getFromCache(__FUNCTION__, $path); if ($res === null) { switch ($this->_connType) { case SftpHelper::TYPE_SFTP: default: $res = $this->_connection->file_exists($path); break; case SftpHelper::TYPE_FTP: $res = file_exists($this->_getStreamUrl($path)); break; } Log::logger()->addDebug('Performing ' . __METHOD__ . ' // result: {res}', ['res' => $res, 'path' => $path]); $this->_addToCache(__FUNCTION__, $path, $res); } return $res; }