Skip to content

Commit

Permalink
Fix processing of YiiMailer configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Stevad authored Aug 30, 2017
1 parent 2711b7b commit 1e39a7d
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions YiiMailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,17 @@ class YiiMailer extends PHPMailer
*/
public function __construct($view = '', $data = [], $layout = '')
{
// load config from CONFIG_FILE and merge with available application params
$config = require(Yii::getPathOfAlias('application.config') . DIRECTORY_SEPARATOR . self::CONFIG_FILE);

//initialize config
if (isset(Yii::app()->params[self::CONFIG_PARAMS])) {
$config = Yii::app()->params[self::CONFIG_PARAMS];
} else {
$config = require(Yii::getPathOfAlias('application.config') . DIRECTORY_SEPARATOR . self::CONFIG_FILE);
$customConfig = Yii::app()->params[self::CONFIG_PARAMS];
if (isset($customConfig['language'])) {
$config['language'] = CMap::mergeArray($config['language'], $customConfig['language']);
unset($customConfig['language']);
}
$config = CMap::mergeArray($config, $customConfig);
}
//set config
$this->setConfig($config);
Expand Down Expand Up @@ -542,5 +548,4 @@ public function save()
return false;
}
}

}

0 comments on commit 1e39a7d

Please sign in to comment.