Extending Gii to make possible to use it to generate base code for plugins/questions templates etc is one of my long term goal (I still have to convince the rest of the team, and we already have a lot of things to do right now).
I used it to generate the Home Page settings, so I'd strongly suggest you have a look into the commits related to that page. You'll see that LS controllers/actions/views system is not 100% in the Yii style, and you must modify few files after you used Gii. See this commit, and adminController + mother class of homepagesettings (Survey_Common_Action) :
github.com/LimeSurvey/LimeSurvey/commit/...cbaebaf24298d2c45fa9
Concerning the external DB:
www.yiiframework.com/doc/guide/1.1/en/database.dao
In Yii1, name space feature is not really integrated. So you must use the class "CDbConnection", and not the name space 'yii\db\Connection'
Code:
'dbExata'=>array(
'class'=>'CDbConnection',
'connectionString'=>'mysql:host=localhost;dbname=testdb',
'username'=>'root',
'password'=>'password',
'emulatePrepare'=>true, // needed by some MySQL installations
),
Your code is valid for Yii2, which is using modern PHP syntax. But LimeSurvey uses Yii1, not Yii2.