console.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. $params = require __DIR__ . '/params.php';
  3. $db = require __DIR__ . '/db.php';
  4. $config = [
  5. 'id' => 'basic-console',
  6. 'basePath' => dirname(__DIR__),
  7. 'bootstrap' => ['log'],
  8. 'controllerNamespace' => 'app\commands',
  9. 'aliases' => [
  10. '@bower' => '@vendor/bower-asset',
  11. '@npm' => '@vendor/npm-asset',
  12. '@tests' => '@app/tests',
  13. ],
  14. 'components' => [
  15. 'cache' => [
  16. 'class' => 'yii\caching\FileCache',
  17. ],
  18. 'log' => [
  19. 'targets' => [
  20. [
  21. 'class' => 'yii\log\FileTarget',
  22. 'levels' => ['error', 'warning'],
  23. ],
  24. ],
  25. ],
  26. 'db' => $db,
  27. ],
  28. 'params' => $params,
  29. /*
  30. 'controllerMap' => [
  31. 'fixture' => [ // Fixture generation command line.
  32. 'class' => 'yii\faker\FixtureController',
  33. ],
  34. ],
  35. */
  36. ];
  37. if (YII_ENV_DEV) {
  38. // configuration adjustments for 'dev' environment
  39. $config['bootstrap'][] = 'gii';
  40. $config['modules']['gii'] = [
  41. 'class' => 'yii\gii\Module',
  42. ];
  43. }
  44. return $config;