| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203 |
- <?php
- namespace Config;
- use CodeIgniter\Database\Config;
- /**
- * Database Configuration
- */
- class Database extends Config
- {
- /**
- * The directory that holds the Migrations and Seeds directories.
- */
- public string $filesPath = APPPATH . 'Database' . DIRECTORY_SEPARATOR;
- /**
- * Lets you choose which connection group to use if no other is specified.
- */
- public string $defaultGroup = 'default';
- /**
- * The default database connection.
- *
- * @var array<string, mixed>
- */
- public array $default = [
- 'DSN' => '',
- 'hostname' => 'localhost',
- 'username' => 'shopdeli',
- 'password' => 'min010206',
- 'database' => 'shopdeli',
- 'DBDriver' => 'MySQLi',
- 'DBPrefix' => '',
- 'pConnect' => false,
- 'DBDebug' => true,
- 'charset' => 'utf8mb4',
- 'DBCollat' => 'utf8mb4_general_ci',
- 'swapPre' => '',
- 'encrypt' => false,
- 'compress' => false,
- 'strictOn' => false,
- 'failover' => [],
- 'port' => 3306,
- 'numberNative' => false,
- 'foundRows' => false,
- 'dateFormat' => [
- 'date' => 'Y-m-d',
- 'datetime' => 'Y-m-d H:i:s',
- 'time' => 'H:i:s',
- ],
- ];
- // /**
- // * Sample database connection for SQLite3.
- // *
- // * @var array<string, mixed>
- // */
- // public array $default = [
- // 'database' => 'database.db',
- // 'DBDriver' => 'SQLite3',
- // 'DBPrefix' => '',
- // 'DBDebug' => true,
- // 'swapPre' => '',
- // 'failover' => [],
- // 'foreignKeys' => true,
- // 'busyTimeout' => 1000,
- // 'synchronous' => null,
- // 'dateFormat' => [
- // 'date' => 'Y-m-d',
- // 'datetime' => 'Y-m-d H:i:s',
- // 'time' => 'H:i:s',
- // ],
- // ];
- // /**
- // * Sample database connection for Postgre.
- // *
- // * @var array<string, mixed>
- // */
- // public array $default = [
- // 'DSN' => '',
- // 'hostname' => 'localhost',
- // 'username' => 'root',
- // 'password' => 'root',
- // 'database' => 'ci4',
- // 'schema' => 'public',
- // 'DBDriver' => 'Postgre',
- // 'DBPrefix' => '',
- // 'pConnect' => false,
- // 'DBDebug' => true,
- // 'charset' => 'utf8',
- // 'swapPre' => '',
- // 'failover' => [],
- // 'port' => 5432,
- // 'dateFormat' => [
- // 'date' => 'Y-m-d',
- // 'datetime' => 'Y-m-d H:i:s',
- // 'time' => 'H:i:s',
- // ],
- // ];
- // /**
- // * Sample database connection for SQLSRV.
- // *
- // * @var array<string, mixed>
- // */
- // public array $default = [
- // 'DSN' => '',
- // 'hostname' => 'localhost',
- // 'username' => 'root',
- // 'password' => 'root',
- // 'database' => 'ci4',
- // 'schema' => 'dbo',
- // 'DBDriver' => 'SQLSRV',
- // 'DBPrefix' => '',
- // 'pConnect' => false,
- // 'DBDebug' => true,
- // 'charset' => 'utf8',
- // 'swapPre' => '',
- // 'encrypt' => false,
- // 'failover' => [],
- // 'port' => 1433,
- // 'dateFormat' => [
- // 'date' => 'Y-m-d',
- // 'datetime' => 'Y-m-d H:i:s',
- // 'time' => 'H:i:s',
- // ],
- // ];
- // /**
- // * Sample database connection for OCI8.
- // *
- // * You may need the following environment variables:
- // * NLS_LANG = 'AMERICAN_AMERICA.UTF8'
- // * NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS'
- // * NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD HH24:MI:SS'
- // * NLS_TIMESTAMP_TZ_FORMAT = 'YYYY-MM-DD HH24:MI:SS'
- // *
- // * @var array<string, mixed>
- // */
- // public array $default = [
- // 'DSN' => 'localhost:1521/XEPDB1',
- // 'username' => 'root',
- // 'password' => 'root',
- // 'DBDriver' => 'OCI8',
- // 'DBPrefix' => '',
- // 'pConnect' => false,
- // 'DBDebug' => true,
- // 'charset' => 'AL32UTF8',
- // 'swapPre' => '',
- // 'failover' => [],
- // 'dateFormat' => [
- // 'date' => 'Y-m-d',
- // 'datetime' => 'Y-m-d H:i:s',
- // 'time' => 'H:i:s',
- // ],
- // ];
- /**
- * This database connection is used when running PHPUnit database tests.
- *
- * @var array<string, mixed>
- */
- public array $tests = [
- 'DSN' => '',
- 'hostname' => '127.0.0.1',
- 'username' => 'eventinter',
- 'password' => 'min010206!',
- 'database' => 'eventinter', //:memory:
- 'DBDriver' => 'SQLite3',
- 'DBPrefix' => 'db_', // Needed to ensure we're working correctly with prefixes live. DO NOT REMOVE FOR CI DEVS
- 'pConnect' => false,
- 'DBDebug' => true,
- 'charset' => 'utf8',
- 'DBCollat' => '',
- 'swapPre' => '',
- 'encrypt' => false,
- 'compress' => false,
- 'strictOn' => false,
- 'failover' => [],
- 'port' => 3306,
- 'foreignKeys' => true,
- 'busyTimeout' => 1000,
- 'dateFormat' => [
- 'date' => 'Y-m-d',
- 'datetime' => 'Y-m-d H:i:s',
- 'time' => 'H:i:s',
- ],
- ];
- public function __construct()
- {
- parent::__construct();
- // Ensure that we always set the database group to 'tests' if
- // we are currently running an automated test suite, so that
- // we don't overwrite live data on accident.
- if (ENVIRONMENT === 'testing') {
- $this->defaultGroup = 'tests';
- }
- }
- }
|