| Conditions | 4 |
| Paths | 8 |
| Total Lines | 24 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 15 |
| CRAP Score | 4.026 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | 50 | public function bootstrap($app) |
|
| 19 | { |
||
| 20 | // Make sure to register the base folder as alias as well or things like assets won't work anymore |
||
| 21 | 50 | \Yii::setAlias('@bedezign/yii2/audit', __DIR__); |
|
| 22 | |||
| 23 | 50 | if ($app instanceof \yii\console\Application) { |
|
| 24 | $app->controllerMap['audit'] = 'bedezign\yii2\audit\commands\AuditController'; |
||
| 25 | } |
||
| 26 | |||
| 27 | 50 | $moduleName = Audit::findModuleIdentifier(); |
|
| 28 | 50 | if ($moduleName) { |
|
| 29 | // The module was added in the configuration, make sure to add it to the application bootstrap so it gets loaded |
||
| 30 | 50 | $app->bootstrap[] = $moduleName; |
|
| 31 | 50 | $app->bootstrap = array_unique($app->bootstrap, SORT_REGULAR); |
|
| 32 | 50 | } |
|
| 33 | |||
| 34 | 50 | if ($app->has('i18n')) { |
|
| 35 | 50 | $app->i18n->translations['audit'] = [ |
|
| 36 | 50 | 'class' => 'yii\i18n\PhpMessageSource', |
|
| 37 | 50 | 'sourceLanguage' => 'en', |
|
| 38 | 50 | 'basePath' => '@bedezign/yii2/audit/messages', |
|
| 39 | ]; |
||
| 40 | 50 | } |
|
| 41 | 50 | } |
|
| 42 | } |
||
| 43 |