uspilot/db_init

Database init class

v1.0.1 2023-02-03 05:11 UTC

This package is auto-updated.

Last update: 2024-08-30 01:37:56 UTC


README

Use this class to do initialization of MySQL database using PDO engine

Installation

$composer require uspilot/db_init

Then copy ini/ folder to your php working dir

Usage

use \DBInit\DBInit;
$pdo = DBInit::initialize();

Check that connection is still alive or not:

if (!DBInit::checkAlive()) $pdo = DBInit::initialize();

Get handler to active PDO connection:

$pdo = DBInit::getPdo()?: DBInit::initialize();

Default ini file is 'ini/db_config.php', default path to folder is your php program working dir

'host' file contain section name from db_config.php configuration file.