| @@ 20-38 (lines=19) @@ | ||
| 17 | ||
| 18 | protected $singleSignOn = false; |
|
| 19 | ||
| 20 | public function init() |
|
| 21 | {
|
|
| 22 | parent::init(); |
|
| 23 | ||
| 24 | $configPath = Yii::getPathOfAlias('frontend.config.cackle').'.php';
|
|
| 25 | if( file_exists($configPath) ) |
|
| 26 | {
|
|
| 27 | $config = require($configPath); |
|
| 28 | $this->siteId = $config['siteId']; |
|
| 29 | $this->siteApiKey = $config['siteApiKey']; |
|
| 30 | ||
| 31 | if( isset($config['singleSignOn']) ) |
|
| 32 | $this->singleSignOn = $config['singleSignOn']; |
|
| 33 | } |
|
| 34 | else |
|
| 35 | {
|
|
| 36 | throw new CHttpException('500', 'Не найден кофигурационный файл cackle.php в папке config');
|
|
| 37 | } |
|
| 38 | } |
|
| 39 | ||
| 40 | /** |
|
| 41 | * @param CActiveRecord|string $channel |
|
| @@ 23-37 (lines=15) @@ | ||
| 20 | ||
| 21 | protected $siteApiKey; |
|
| 22 | ||
| 23 | public function __construct() |
|
| 24 | {
|
|
| 25 | $configPath = Yii::getPathOfAlias('frontend.config.cackle').'.php';
|
|
| 26 | if( file_exists($configPath) ) |
|
| 27 | {
|
|
| 28 | $config = require($configPath); |
|
| 29 | $this->siteId = $config['siteId']; |
|
| 30 | $this->accountApiKey = $config['accountApiKey']; |
|
| 31 | $this->siteApiKey = $config['siteApiKey']; |
|
| 32 | } |
|
| 33 | else |
|
| 34 | {
|
|
| 35 | throw new CHttpException('500', 'Не найден кофигурационный файл cackle.php в папке config');
|
|
| 36 | } |
|
| 37 | } |
|
| 38 | ||
| 39 | /** |
|
| 40 | * @param null $modified |
|