mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-05 20:57:12 +00:00
fix memory footprint
This commit is contained in:
parent
32fdbc4c74
commit
6e1a92f112
1 changed files with 5 additions and 1 deletions
|
|
@ -49,7 +49,11 @@ class ImageUploader implements ImageUploaderInterface
|
|||
|
||||
$image->setPath($path);
|
||||
|
||||
$this->filesystem->write($image->getPath(), file_get_contents($file->getPathname()));
|
||||
$stream = fopen($file->getPathname(), 'r');
|
||||
$this->filesystem->writeStream($image->getPath(), $stream);
|
||||
if (is_resource($stream)) {
|
||||
fclose($stream);
|
||||
}
|
||||
}
|
||||
|
||||
public function remove(string $path): bool
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue