Documentation

Database extends Config
in package

Database Configuration

Table of Contents

Properties

$default  : array<string, mixed>
The default database connection.
$defaultGroup  : string
Lets you choose which connection group to use if no other is specified.
$filesPath  : string
The directory that holds the Migrations and Seeds directories.
$tests  : array<string, mixed>
This database connection is used when running PHPUnit database tests.

Methods

__construct()  : mixed

Properties

$default

The default database connection.

public array<string, mixed> $default = ['DSN' => '', 'hostname' => 'localhost', 'username' => '', 'password' => '', 'database' => '', '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']]

$defaultGroup

Lets you choose which connection group to use if no other is specified.

public string $defaultGroup = 'default'

$filesPath

The directory that holds the Migrations and Seeds directories.

public string $filesPath = APPPATH . 'Database' . DIRECTORY_SEPARATOR

$tests

This database connection is used when running PHPUnit database tests.

public array<string, mixed> $tests = [ 'DSN' => '', 'hostname' => '127.0.0.1', 'username' => '', 'password' => '', 'database' => ':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'], ]

Methods

__construct()

public __construct() : mixed

        
On this page

Search results