2017 © Pedro Peláez
 

library dblib

PHP library for automating MySQL/MariaDb tasks within your project

image

geeshoe/dblib

PHP library for automating MySQL/MariaDb tasks within your project

  • Tuesday, July 3, 2018
  • by geeshoe
  • Repository
  • 0 Watchers
  • 0 Stars
  • 69 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 123 % Grown

The README.md

DbLib

DbLib is a PHP library intended to make it easier to work with MySQL/MariaDb databases within your project., (*1)

Please note that this project is in initial development and as such, some documentation may be incomplete., (*2)

Getting Started

DbLib is intended to be fully compliant with PSR-1, PSR-2, & PSR-4, (*3)

Prerequisites

DbLib works with both MySQL and MariaDb., (*4)

To check if the above PHP extension's are enabled, run the following command in the CLI or add it to a page in your web root..., (*5)

phpinfo(); <-- Use with script in webroot.
php -i <-- Use with CLI

Installing

To add DbLib to your project, run:, (*6)

composer require geeshoe/dblib

If you prefer to use the development branch of dblib-php, use following line of code in the composer.json file., (*7)

composer require geeshoe/dblib dev-develop

Note: The development branch of DbLib is unstable at times and therefor not recommended in a production environment., (*8)

Configure

DbLib Configuration parameters can be set using various formats. However, JSON is the only format currently supported out of the box. Other formats such as .env, yaml, etc.. are soon to follow., (*9)

It is possible to brew your own config adapter using the AbstractConfigObject in the meantime., (*10)

Copy the included dblibConfig_DIST.json to a secure location outside of your projects web root., (*11)

Change the values to reflect your database configuration., (*12)

{
  "dblibConfig" : {
    "hostName" : "127.0.0.1",
    "port" : "3306",
    "userName" : "myUsername",
    "password" : "SomePassword",
    "database" : "OptionalSeeDocumentation"
  }
}

The "database" param is not required. If the database is not specified in the config file, you must explicitly declare the database to use in your SQL statements., (*13)

I.e. 'SELECT * FROM database.tableName';, (*14)

PDO Attributes are not fully supported in the current release. The ability to use attributes is provided but has not yet been implemented in DbLib automatically. This is currently at the top of the development list to bring back PDO Attributes as before. Full support for attributes is intended for the next major release, if not sooner., (*15)

PDO Attributes can be set in the config file as demonstrated above. More than one attribute can be set as follows:, (*16)

"pdoAttributes" : [
     {
       "PDO::ATTR_ERRMODE" : "PDO::ERRMODE_EXCEPTION"
     },
     {
       "PDO::ATTR_CASE" : "PDO::CASE_LOWER"
     }
]

Persistent Connections are planned in the future for DbLib, but currently are not supported. Because DbLib does not explicitly close PDO connections, it is possible to extend the DbLib class and override the connect()method to set PDO::ATTR_PERSISTENT => true., (*17)

Documentation

API & usage documentation is soon to come., (*18)

Authors

Source available at (https://github.com/geeshoe), (*19)

For questions, comments, or rant's, drop me a line at, (*20)

jr (at) geeshoe (dot) com

The Versions

03/07 2018

dev-master

9999999-dev http://www.geeshoe.com

PHP library for automating MySQL/MariaDb tasks within your project

  Sources   Download

MIT Apache-2.0

The Requires

  • php ^7.1
  • ext-pdo_mysql *

 

The Development Requires

database php pdo dblib mysql mariadb geeshoe dbclass

03/07 2018

v0.5.2

0.5.2.0 http://www.geeshoe.com

PHP library for automating MySQL/MariaDb tasks within your project

  Sources   Download

Apache-2.0

The Requires

  • php ^7.1
  • ext-pdo_mysql *

 

The Development Requires

database php pdo dblib mysql mariadb geeshoe dbclass

03/07 2018

dev-develop

dev-develop http://www.geeshoe.com

PHP library for automating MySQL/MariaDb tasks within your project

  Sources   Download

MIT Apache-2.0

The Requires

  • php ^7.1
  • ext-pdo_mysql *

 

The Development Requires

database php pdo dblib mysql mariadb geeshoe dbclass

23/06 2018

v0.5.1

0.5.1.0 http://www.geeshoe.com

PHP library for automating MySQL/MariaDb tasks within your project

  Sources   Download

Apache-2.0

The Requires

  • php ^7.1
  • ext-pdo_mysql *

 

The Development Requires

database php pdo dblib mysql mariadb geeshoe dbclass

22/06 2018

v0.5.0

0.5.0.0 http://www.geeshoe.com

PHP library for automating MySQL/MariaDb tasks within your project

  Sources   Download

Apache-2.0

The Requires

  • php ^7.1
  • ext-pdo_mysql *

 

The Development Requires

database php pdo dblib mysql mariadb geeshoe dbclass

11/06 2018

v0.4.0

0.4.0.0 http://www.geeshoe.com

PHP library for automating MySQL/MariaDb tasks within your project

  Sources   Download

Apache-2.0

The Requires

  • php ^7.1
  • ext-pdo_mysql *

 

The Development Requires

database php pdo dblib mysql mariadb geeshoe dbclass

19/05 2018

0.3.0

0.3.0.0 http://www.geeshoe.com

PHP library for automating MySQL/MariaDb tasks within your project

  Sources   Download

Apache-2.0

The Requires

  • php ^7.1
  • ext-pdo_mysql *

 

database php pdo dblib mysql mariadb geeshoe dbclass

10/05 2018

v0.2.0

0.2.0.0 http://www.geeshoe.com

PHP library for automating MySQL/MariaDb tasks within your project

  Sources   Download

MIT

pdo dblib mysql mariadb geeshoe dbclass

26/04 2018

v0.1.0

0.1.0.0 http://www.geeshoe.com

PHP library for automating MySQL/MariaDb tasks within your project

  Sources   Download

MIT

pdo dblib mysql mariadb geeshoe dbclass