/** * {@inheritdoc} * * This is called from \Sirius\Upload\Handler::processSingleFile() which expects a boolean return value, * and as \Bolt\FilesystemInterface::putStream only returns void or throws an error, we catch * IOExceptions here and return a false on exception. */ public function moveUploadedFile($localFile, $destination) { try { $this->filesystem->putStream($destination, fopen($localFile, 'r+')); } catch (IOException $e) { return false; } return true; }
private function doCopy(FilesystemInterface $fsOrigin, FilesystemInterface $fsTarget, $origin, $target, $override) { if ($fsTarget->has($target) && ($override === false || $override === null && $fsOrigin->getTimestamp($origin) <= $fsTarget->getTimestamp($target))) { return; } $buffer = $fsOrigin->readStream($origin); $fsTarget->putStream($target, $buffer); $buffer->close(); }
/** * {@inheritdoc} * * @throws IOException * * This is called from \Sirius\Upload\Handler::processSingleFile() which expects a boolean return value, * and as \Bolt\FilesystemInterface::putStream only returns void or throws an error, we catch * IOExceptions here and return a false on exception. */ public function moveUploadedFile($localFile, $destination) { $this->filesystem->putStream($destination, fopen($localFile, 'r+')); return true; }