Skip to content

Commit

Permalink
Improve check dir exists
Browse files Browse the repository at this point in the history
Co-authored-by: Grégory PLANCHAT <[email protected]>
  • Loading branch information
JoMessina and gplanchat authored Jan 17, 2024
1 parent 44761cb commit 2049f48
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/Adapter/Filesystem/Satellite.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,11 @@ public function build(
fclose($stream);
}
} else {
$stream = fopen($this->workdir.'/'.$file->getPath(), 'wb');
if (!$stream) {
$dirname = dirname($this->workdir.'/'.$file->getPath());
if (!is_dir($dirname))
{
mkdir($dirname, 0755, true);
}
$stream = fopen($this->workdir.'/'.$file->getPath(), 'wb');
$dirname = dirname($this->workdir.'/'.$file->getPath());
if (!file_exists($dirname)) {
mkdir($dirname, 0755, true);
}
$stream = fopen($this->workdir.'/'.$file->getPath(), 'wb');
stream_copy_to_stream($file->asResource(), $stream);
fclose($stream);
}
Expand Down

0 comments on commit 2049f48

Please sign in to comment.