Skip to content

Commit

Permalink
add /app/config/Database.php
Browse files Browse the repository at this point in the history
Prevent "Class not found" error that was occurred in some environments
  • Loading branch information
code-path authored Jan 13, 2025
1 parent 54d948b commit 7b8f5c5
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions application/config/Database.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?php

namespace App\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 = 'cms';

/**
* The cms database connection.
*
* @var array<string, mixed>
*/
public array $cms = [
'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
];

/**
* The account database connection.
*
* @var array<string, mixed>
*/
public array $account = [
'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
];
}

0 comments on commit 7b8f5c5

Please sign in to comment.