index.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. // comment out the following two lines when deployed to production
  3. //defined('YII_DEBUG') or define('YII_DEBUG', false);
  4. //defined('YII_ENV') or define('YII_ENV', 'prod');
  5. //error_reporting(E_ALL);
  6. //ini_set('display_errors','on');
  7. require(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php');
  8. $config = [
  9. 'id' => 'basic',
  10. 'basePath' => __DIR__,
  11. 'components' => [
  12. 'db' => [
  13. 'class' => 'yii\db\Connection',
  14. 'dsn' => 'mysql:host=tfb-database;dbname=hello_world',
  15. 'username' => 'benchmarkdbuser',
  16. 'password' => 'benchmarkdbpass',
  17. 'charset' => 'utf8',
  18. 'attributes' => [
  19. PDO::ATTR_PERSISTENT => true,
  20. ],
  21. 'enableLogging' => false,
  22. 'enableProfiling' => false,
  23. 'enableSchemaCache' => true,
  24. 'schemaCache' => 'cache',
  25. 'schemaCacheDuration' => 3600,
  26. ],
  27. 'cache' => [
  28. 'class' => 'yii\caching\FileCache',
  29. 'cachePath' => '/tmp/yii2-cache',
  30. ],
  31. 'urlManager' => [
  32. 'enablePrettyUrl' => true,
  33. ],
  34. ],
  35. ];
  36. (new yii\web\Application($config))->run();