Download the PHP package phossa/phossa-db without Composer
On this page you can find all versions of the php package phossa/phossa-db. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package phossa-db
phossa-db
Introduction
phossa-db is a PHP db connection management library which handles the interaction with db.
It requires PHP 5.4 and supports PHP 7.0+, HHVM. It is compliant with PSR-1, PSR-2, PSR-4.
Features
-
Simple interface. Nothing you don't need.
-
Multiple db platform/driver support, currently PDO (all PDO drivers) and Mysqli.
-
Handles multiple connections through driver manager
- Round-robin load balancing
Multiple db connections are used in round-robin fashion and weighting factor (1-10) supported. Each connection is monitored (pinged).
- driver tagging, so user can tag different db connection as 'reader' or 'writer'
-
Easy profiling, get each executed sql and its execution time.
- Secure. All SQL executed through prepare/execute in low-level drivers.
Getting started
-
Installation
Install via the
composer
utility.or add the following lines to your
composer.json
Usage
-
Driver
-
DDL using execute()
- SELECT using query()
-
-
Statment
Statement
is returned by$db->prepare()
. -
Result
Result
is returned by$db->execute()
,$db->query()
or$stmt->execute()
Driver manager
Driver manager manages multiple db connections. Weighting factor N means add
one driver virtually N times. Adding driver A with factor 5 and adding driver
B with factor 1 into the pool, means when calling getDriver()
, user will
get A five times vs B for one time.
SQL profiling
Get the executed SQL and its execution time.
Dependencies
-
PHP >= 5.4.0
- phossa/phossa-shared ~1.0.10