/** * 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; }
public function stream_close() { return $this->state->close($this->handle); }