forked from pvsaintpe/yii2-gii-plus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Module.php
46 lines (41 loc) · 1.29 KB
/
Module.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
namespace pvsaintpe\gii\plus;
use pvsaintpe\gii\Module as GiiModule;
use pvsaintpe\gii\plus\helpers\Helper;
use yii\web\Application as WebApplication;
use Yii;
class Module extends GiiModule
{
/**
* @inheritdoc
*/
public function bootstrap($app)
{
parent::bootstrap($app);
foreach (Helper::getDbConnections() as $db) {
if (in_array($db->getDriverName(), ['mysql', 'mysqli'])) {
$db->schemaMap = array_merge($db->schemaMap, [
'mysql' => 'pvsaintpe\db\components\mysql\Schema',
'mysqli' => 'pvsaintpe\db\components\mysql\Schema'
]);
}
}
if ($app instanceof WebApplication) {
$this->setViewPath(Yii::getAlias('@pvsaintpe/gii/views'));
}
}
/**
* @inheritdoc
*/
protected function coreGenerators()
{
return array_merge(
parent::coreGenerators(),
[
'base_model' => ['class' => 'pvsaintpe\gii\plus\generators\base\model\Generator'],
'custom_model' => ['class' => 'pvsaintpe\gii\plus\generators\custom\model\Generator'],
'fixture' => ['class' => 'pvsaintpe\gii\plus\generators\fixture\Generator']
]
);
}
}