console.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. 'authManager' => [
  28. 'class' => 'yii\rbac\DbManager',
  29. // 'defaultRoles' => ['guest'],
  30. ],
  31. ],
  32. "modules"=>[
  33. 'user' => [
  34. 'class' => 'dektrium\user\Module',
  35. 'admins' => ['root'],
  36. 'adminPermission' => 'admin'
  37. ],
  38. 'rbac' => 'dektrium\rbac\RbacWebModule',
  39. ],
  40. 'params' => $params,
  41. /*
  42. 'controllerMap' => [
  43. 'fixture' => [ // Fixture generation command line.
  44. 'class' => 'yii\faker\FixtureController',
  45. ],
  46. ],
  47. */
  48. ];
  49. if (YII_ENV_DEV) {
  50. // configuration adjustments for 'dev' environment
  51. $config['bootstrap'][] = 'gii';
  52. $config['modules']['gii'] = [
  53. 'class' => 'yii\gii\Module',
  54. ];
  55. }
  56. return $config;