Skip to content

Commit

Permalink
only mkdir for local files
Browse files Browse the repository at this point in the history
  • Loading branch information
jszobody committed Apr 26, 2021
1 parent c947df1 commit 7188c77
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/Models/LocalFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ protected function buildReadableStream(): StreamInterface
*/
protected function buildWritableStream(): StreamInterface
{
if(!is_dir(dirname($this->getSource()))) {
mkdir(dirname($this->getSource()), 0777, true);
}

return stream_for(fopen($this->getSource(), 'w'));
}
}
}
4 changes: 0 additions & 4 deletions src/ZipStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,6 @@ protected function getOutputStream()
public function saveTo( $output ): int
{
if (!$output instanceof FileContract) {
if(!is_dir($output)) {
mkdir($output, 0777, true);
}

$output = File::make(Str::finish($output, "/") . $this->getName());
}

Expand Down

0 comments on commit 7188c77

Please sign in to comment.