/** * Initializes the application component. * This method overrides the parent implementation by establishing the database connection. */ public function init() { if (is_string($this->db)) { $this->db = Yii::$app->getComponent($this->db); } if (!$this->db instanceof Connection) { throw new InvalidConfigException("DbManager::db must be either a DB connection instance or the application component ID of a DB connection."); } $this->_usingSqlite = !strncmp($this->db->getDriverName(), 'sqlite', 6); parent::init(); }
/** * Initializes the application component. * This method overrides parent implementation by loading the authorization data * from PHP script. */ public function init() { parent::init(); $this->authFile = Yii::getAlias($this->authFile); $this->load(); }