Documentation

DBInstance
in package
uses FileConfiguration

Provides a PDO DB connection to instances of \Pipit\Classes\Data\DBObject and its descendants

Tags
author

Jason Savell jsavell@library.tamu.edu

Table of Contents

Constants

CONFIG_FILE  = "db.instance"

Properties

$handle  : PDO
$configs  : array<string, array<string|int, mixed>>
$debug  : bool
$instance  : DBInstance
$type  : string

Methods

getInstance()  : DBInstance
Returns a singleton instance of the db class
getType()  : string
Returns the type of the DBInstance
isDebug()  : bool
Returns whether or not the DBInstance is in debug mode
configurationFileExists()  : bool
Checks for the existence of a file with the given filename
getConfigurationFromFileName()  : array<string|int, mixed>
Retrieves a config array by its corresponding filename
__construct()  : mixed
Instantiates a new \PDO instance using the DBInstance.config config file
loadConfigurationFile()  : void
Loads and parses a php ini file into an array keyed by ini sections

Constants

CONFIG_FILE

private mixed CONFIG_FILE = "db.instance"

Properties

$configs

private array<string, array<string|int, mixed>> $configs = []

An array of configuration arrays

$debug

private bool $debug = false

The debug status

$type

private string $type = 'mysql'

The SQL type

Methods

getType()

Returns the type of the DBInstance

public getType() : string
Return values
string

isDebug()

Returns whether or not the DBInstance is in debug mode

public isDebug() : bool
Return values
bool

configurationFileExists()

Checks for the existence of a file with the given filename

protected configurationFileExists(string $configurationFileName) : bool
Parameters
$configurationFileName : string

The name of the file without extension or path

Return values
bool

getConfigurationFromFileName()

Retrieves a config array by its corresponding filename

protected getConfigurationFromFileName(string $configurationFileName) : array<string|int, mixed>
Parameters
$configurationFileName : string

The name of the file without extension or path

Return values
array<string|int, mixed>

__construct()

Instantiates a new \PDO instance using the DBInstance.config config file

private __construct() : mixed

loadConfigurationFile()

Loads and parses a php ini file into an array keyed by ini sections

private loadConfigurationFile(string $configurationFileName) : void
Parameters
$configurationFileName : string

The name of the file without extension or path


        
On this page

Search results