Download the PHP package phossa2/db without Composer
On this page you can find all versions of the php package phossa2/db. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package db
Short Description DB connection, management, statistics library for PHP.
License MIT
Homepage https://github.com/phossa2/db
Informations about the package db
phossa2/db
phossa2/db is a PHP db connection management library which handles the interaction with db.
It requires PHP 5.4, supports PHP 7.0+ and HHVM. It is compliant with PSR-1, PSR-2, PSR-3, PSR-4, and the proposed PSR-5.
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' etc.
-
Easy profiling, get each executed sql and its execution time.
- Secure. All SQL executed through prepare/execute in low-level drivers.
Installation
Install via the composer
utility.
or add the following lines to your composer.json
Usage
-
Driver
-
DDL
- SELECT
-
-
Statment
Statement
is returned after$db->prepare()
. -
Result
Result
is returned by$db->getResult()
or$stmt->getResult()
Mysqli
Mysqli driver is also supported.
Note: named parameters are not supported in Mysqli driver.
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.
Method overloading
Methods from Phossa2\Db\Interfaces\ResultInterface
can be accessed through
the db driver after successful execution of a query.
Change log
Please see CHANGELOG from more information.
Testing
Contributing
Please see CONTRIBUTE for more information.
Dependencies
-
PHP >= 5.4.0
- phossa2/shared >= 2.0.25