Skip to content

Commit

Permalink
'bug'
Browse files Browse the repository at this point in the history
  • Loading branch information
yidashi committed Mar 2, 2017
1 parent dfb664a commit 0c08bcd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common/modules/attachment/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function bootstrap($app)
'path' => '@storagePath/upload',
],
'baseUrl' => '@storageUrl/upload',
'imageProcessor' => 'common\modules\attachment\components\image\Local'
'imageProcessor' => ['class' => 'common\modules\attachment\components\image\Local']
];
if (isset($this->params['filesystem_type'])) {
switch ($this->params['filesystem_type']) {
Expand Down
2 changes: 1 addition & 1 deletion common/modules/attachment/components/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function init()
parent::init();
$this->baseUrl = \Yii::getAlias($this->baseUrl);
$this->fs = \Yii::createObject($this->fs);
$this->imageProcessor = \Yii::createObject($this->imageProcessor, ['baseUrl' => $this->baseUrl]);
$this->imageProcessor = \Yii::createObject(ArrayHelper::merge($this->imageProcessor, ['baseUrl' => $this->baseUrl]));
}

public function getPath($url)
Expand Down
2 changes: 1 addition & 1 deletion common/modules/attachment/models/Attachment.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ public function makeCropStorage($width, $height, $x, $y)
$attachment = static::findByHash($hash);
if (empty($attachment)) {
$fileName = $hash . '.' . $this->extension;
$path = trim(pathinfo($this->path, PATHINFO_DIRNAME), '');
$path = trim(pathinfo($this->path, PATHINFO_DIRNAME), '.');
$filePath = ($path ? ($path . '/') : '') . $fileName;
if (Yii::$app->storage->upload($filePath, $url)) {
$attachment = new static();
Expand Down

0 comments on commit 0c08bcd

Please sign in to comment.