/** * This method is called in response to all stat() related functions * * Retrieves information about a file * * @see SFTP_StreamWrapper::stream_stat() * @param String $path * @param Integer $flags * @return mixed * @access public */ public function url_stat($path, $flags) { $connection = $this->stream_open($path, NULL, NULL, $opened_path); if ($connection === false) { return FALSE; } if ($flags === STREAM_URL_STAT_LINK) { $stat = $this->sftp->lstat($this->path); } else { $stat = $this->sftp->stat($this->path); } $this->stream_close(); if (!empty($stat)) { // mode fix $stat['mode'] = $stat['permissions']; unset($stat['permissions']); return $stat; } else { return FALSE; } }