Skip to content

Commit

Permalink
Merge pull request #46 from Rjgoolsby/master
Browse files Browse the repository at this point in the history
Create Default Path if Upload Dir not set
  • Loading branch information
zinzinday committed Jan 7, 2016
2 parents a9a428d + bcbcae8 commit 9848704
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions RedactorModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ public function getOwnerPath()
*/
public function getSaveDir()
{
$path = Yii::getAlias($this->uploadDir);
if (!file_exists($path)) {
throw new InvalidConfigException('Invalid config $uploadDir');
}
if (FileHelper::createDirectory($path . DIRECTORY_SEPARATOR . $this->getOwnerPath(), 0777)) {
return $path . DIRECTORY_SEPARATOR . $this->getOwnerPath();
$path = Yii::getAlias($this->uploadDir) . DIRECTORY_SEPARATOR . $this->getOwnerPath();
if(!file_exists($path)){
if (!FileHelper::createDirectory($path, 0775,$recursive = true )) {
throw new InvalidConfigException('$uploadDir does not exist and default path creation failed');
}
}
return $path;
}

/**
Expand Down

0 comments on commit 9848704

Please sign in to comment.