Skip to content

Commit

Permalink
fixed bugs after laravel storage changes
Browse files Browse the repository at this point in the history
fixed the publishes config file
added back the chunks folder creations until the storage streams will
be used
  • Loading branch information
Martin Kluska committed Jun 29, 2016
1 parent eb5a9bb commit 8e471a5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Providers/ChunkUploadServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ protected function registerConfig()

// publish the config
$this->publishes([
$configPath => config_path($configFileName.'.php'),
$configPath => config_path($configFileName),
]);

// merge the default config to prevent any crash or unfiled configs
Expand Down
14 changes: 14 additions & 0 deletions src/Save/ChunkSave.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ public function getFile()
protected function handleChunkMerge()
{
// prepare the folder and file path
$this->createChunksFolderIfNeeded();
$file = $this->getChunkFilePath();

// delete the old chunk
Expand Down Expand Up @@ -208,4 +209,17 @@ public function chunkDisk()
{
return $this->chunkStorage()->disk();
}

/**
* Crates the chunks folder if doesnt exists. Uses recursive create
*/
protected function createChunksFolderIfNeeded()
{
$path = $this->getChunksPath();

// creates the chunks dir
if (!file_exists($path)) {
mkdir($path, 0777, true);
}
}
}

0 comments on commit 8e471a5

Please sign in to comment.