public function __construct($yii = null) { if ($yii === null) { $this->yii = Yii::app(); } $this->setConfig(); $this->initClient(); $this->login(); }