Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

92 строки
2.3KB

  1. <?php
  2. namespace Config;
  3. use CodeIgniter\Database\Config;
  4. /**
  5. * Database Configuration
  6. */
  7. class Database extends Config
  8. {
  9. /**
  10. * The directory that holds the Migrations
  11. * and Seeds directories.
  12. *
  13. * @var string
  14. */
  15. public $filesPath = APPPATH . 'Database' . DIRECTORY_SEPARATOR;
  16. /**
  17. * Lets you choose which connection group to
  18. * use if no other is specified.
  19. *
  20. * @var string
  21. */
  22. public $defaultGroup = 'default';
  23. /**
  24. * The default database connection.
  25. *
  26. * @var array
  27. */
  28. public $default = [
  29. 'DSN' => '',
  30. 'hostname' => 'localhost',
  31. 'username' => 'root',
  32. 'password' => '',
  33. 'database' => 'epic',
  34. 'DBDriver' => 'MySQLi',
  35. 'DBPrefix' => '',
  36. 'pConnect' => false,
  37. 'DBDebug' => (ENVIRONMENT !== 'production'),
  38. 'charset' => 'utf8',
  39. 'DBCollat' => 'utf8_general_ci',
  40. 'swapPre' => '',
  41. 'encrypt' => false,
  42. 'compress' => false,
  43. 'strictOn' => false,
  44. 'failover' => [],
  45. 'port' => 3306,
  46. ];
  47. /**
  48. * This database connection is used when
  49. * running PHPUnit database tests.
  50. *
  51. * @var array
  52. */
  53. public $tests = [
  54. 'DSN' => '',
  55. 'hostname' => '127.0.0.1',
  56. 'username' => '',
  57. 'password' => '',
  58. 'database' => ':memory:',
  59. 'DBDriver' => 'SQLite3',
  60. 'DBPrefix' => 'db_', // Needed to ensure we're working correctly with prefixes live. DO NOT REMOVE FOR CI DEVS
  61. 'pConnect' => false,
  62. 'DBDebug' => (ENVIRONMENT !== 'production'),
  63. 'charset' => 'utf8',
  64. 'DBCollat' => 'utf8_general_ci',
  65. 'swapPre' => '',
  66. 'encrypt' => false,
  67. 'compress' => false,
  68. 'strictOn' => false,
  69. 'failover' => [],
  70. 'port' => 3306,
  71. 'foreignKeys' => true,
  72. ];
  73. public function __construct()
  74. {
  75. parent::__construct();
  76. // Ensure that we always set the database group to 'tests' if
  77. // we are currently running an automated test suite, so that
  78. // we don't overwrite live data on accident.
  79. if (ENVIRONMENT === 'testing') {
  80. $this->defaultGroup = 'tests';
  81. }
  82. }
  83. }