public function stream_read($count) { $result = $this->state->read($this->handle, $count); if (strlen($result) < $count) { $this->eof = true; } return $result; }
/** * Download a remote file * * @param string $source remove file * @param string $target local file * @return bool * * @throws \SMBBundle\SMB\Exception\NotFoundException * @throws \SMBBundle\SMB\Exception\InvalidTypeException */ public function get($source, $target) { $this->connect(); $sourceHandle = $this->state->open($this->buildUrl($source), 'r'); $targetHandle = fopen($target, 'wb'); while ($data = $this->state->read($sourceHandle, 4096)) { fwrite($targetHandle, $data); } $this->state->close($sourceHandle); return true; }