console.php 878 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. Yii::setAlias('tests', __DIR__ . '/../tests');
  3. $params = require(__DIR__ . '/params.php');
  4. return [
  5. 'id' => 'basic-console',
  6. 'basePath' => dirname(__DIR__),
  7. 'preload' => ['log'],
  8. 'controllerPath' => dirname(__DIR__) . '/commands',
  9. 'controllerNamespace' => 'app\commands',
  10. 'extensions' => require(__DIR__ . '/../vendor/yiisoft/extensions.php'),
  11. 'components' => [
  12. 'cache' => [
  13. 'class' => 'yii\caching\FileCache',
  14. ],
  15. 'log' => [
  16. 'targets' => [
  17. [
  18. 'class' => 'yii\log\FileTarget',
  19. 'levels' => ['error', 'warning'],
  20. ],
  21. ],
  22. ],
  23. 'db' => [
  24. 'class' => 'yii\db\Connection',
  25. 'dsn' => 'mysql:host=localhost;dbname=yii2basic',
  26. 'username' => 'root',
  27. 'password' => '',
  28. 'charset' => 'utf8',
  29. ],
  30. 'fixture' => [
  31. 'class' => 'yii\test\DbFixtureManager',
  32. 'basePath' => '@tests/unit/fixtures',
  33. ],
  34. ],
  35. 'params' => $params,
  36. ];