-
Notifications
You must be signed in to change notification settings - Fork 29
/
Bootstrap.php
executable file
·28 lines (25 loc) · 1.15 KB
/
Bootstrap.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
<?php
namespace insolita\migrik;
use yii\base\Application;
use yii\base\BootstrapInterface;
class Bootstrap implements BootstrapInterface
{
/**
* Bootstrap method to be called during application bootstrap stage.
*
* @param Application $app the application currently running
*/
public function bootstrap($app)
{
if ($app->hasModule('gii')) {
if (!isset($app->getModule('gii')->generators['migrik'])) {
$app->getModule('gii')->generators['migrik'] = 'insolita\migrik\gii\StructureGenerator';
$app->getModule('gii')->generators['migrikdata'] = 'insolita\migrik\gii\DataGenerator';
$app->getModule('gii')->generators['migrikdoc'] = 'insolita\migrik\gii\ByModelGenerator';
}
\Yii::$container->set('insolita\migrik\contracts\IMigrationTableResolver', 'insolita\migrik\resolver\TableResolver');
\Yii::$container->set('insolita\migrik\contracts\IPhpdocResolver', 'insolita\migrik\resolver\PhpDocResolver');
\Yii::$container->set('insolita\migrik\contracts\IModelResolver', 'insolita\migrik\resolver\ModelResolver');
}
}
}