PHPackages                             geeshoe/db-connector - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. geeshoe/db-connector

AbandonedArchivedLibrary[Database &amp; ORM](/categories/database)

geeshoe/db-connector
====================

PHP Database connection library.

v2.1.0(7y ago)070[2 issues](https://github.com/geeShoe/db-connector/issues)1Apache-2.0PHPPHP ^7.1

Since Nov 29Pushed 6y agoCompare

[ Source](https://github.com/geeShoe/db-connector)[ Packagist](https://packagist.org/packages/geeshoe/db-connector)[ Docs](http://www.geeshoe.com)[ RSS](/packages/geeshoe-db-connector/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (5)Versions (10)Used By (1)

db-connector
============

[](#db-connector)

[![Build Status](https://camo.githubusercontent.com/c50bec7b36b5a848629c8824f21beb51ff994e6b1a01fdabc4e73f7cddecc090/68747470733a2f2f7472617669732d63692e636f6d2f67656553686f652f64622d636f6e6e6563746f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/geeShoe/db-connector)

Db-Connector is a tool set to help manage and provide database connection's within your PHP application.

*Support for PHP 7.1 ended on December 1st, 2019. Please upgrade to the latest version of db-connector.*

Getting Started
---------------

[](#getting-started)

Db-Connector is intended to be fully compliant with [PSR-1](https://www.php-fig.org/psr/psr-1/), [PSR-2](https://www.php-fig.org/psr/psr-2/), &amp; [PSR-4](https://www.php-fig.org/psr/psr-4/)

Latest Recommended version: v2.1.0 Released May 2nd, 2019

Test coverage: 99% Includes Unit and Functional Tests.

```
   Time: 288 ms, Memory: 6.00 MB

   OK (40 tests, 94 assertions)

```

Prerequisites
-------------

[](#prerequisites)

Db-Connector works with both MySQL and MariaDb database's. Support for other database's is intended to be implemented in future releases.

- PHP 7.2+
- [PDO\_MYSQL extension](http://php.net/manual/en/ref.pdo-mysql.php)
- [PDO\_JSON extension](http://php.net/manual/en/book.json.php) - If using the supplied JSON configuration adapter.

To check if the above PHP extension's are enabled, run the following command in the CLI or use phpinfo() in a non-public page on your web server.

```
phpinfo();  '/path/to/file,
        'key' => '/path/to/file,
        'verify' => true
    ];

```

For more information on [Persistent Connections](http://php.net/manual/en/pdo.connections.php).

Usage
-----

[](#usage)

Determine which method you want to use for parsing the database credentials.

Using the EnvConfigAdapter:

```
use Geeshoe\DbConnector\ConfigAdapter\EnvConfigAdapter;

$configAdapter = new EnvConfigAdapter();
$configAdapter->initialize();

$credentialsObject = $configAdapter->getParams();

```

Using the JsonConfigAdapter:

```
use Geeshoe\DbConnector\ConfigAdapter\JsonConfigAdapter;

$configAdapter = new JsonConfigAdapter('/path/to/dbConnector.json');
$configAdapter->initialize();

$credentialsObject = $configAdapter->getParams();

```

Using the ArrayConfigAdapter:

```
use Geeshoe\DbConnector\ConfigAdapter\ArrayConfigAdapter;

$configAdapter = new ArrayConfigAdapter(['host'=> 'localhost', 'port' => 1234]);
$configAdapter->initialize();

$credentialsObject = $configAdapter->getParams();

```

After calling getParams() from either of the above method's, create a new PDO database connection as follow's:

```
$connector = new DbConnector($credentialsObject);
$dbc = $connector->getConnection();

```

`getConnection()` return's a new [PDO object](http://php.net/manual/en/book.pdo.php) that is ready to use.

Documentation
-------------

[](#documentation)

More extensive documentation on Db-Connector is to be released soon. In the meantime, all of the methods and properties are well documented within the code base.

Authors
-------

[](#authors)

- **Jesse Rushlow** - *Lead developer* - [geeShoe Development](http://geeshoe.com)

Source available at ()

For questions, comments, or rant's, drop me a line at

```
jr (at) geeshoe (dot) com

```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~60 days

Recently: every ~84 days

Total

8

Last Release

2304d ago

Major Versions

v1.1.1 → v2.0.02019-02-21

2.x-dev → 3.x-dev2020-01-23

PHP version history (2 changes)v1.0.0PHP ^7.1

3.x-devPHP ^7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/fd470edf3ea833b940c8233bef61fad9f7f4d2d6fff725d605153a42a39d673b?d=identicon)[rushlow-development](/maintainers/rushlow-development)

---

Top Contributors

[![jrushlow](https://avatars.githubusercontent.com/u/40327885?v=4)](https://github.com/jrushlow "jrushlow (149 commits)")

---

Tags

phpdatabasemysqlmariadbpdodblibgeeshoedbconnector

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/geeshoe-db-connector/health.svg)

```
[![Health](https://phpackages.com/badges/geeshoe-db-connector/health.svg)](https://phpackages.com/packages/geeshoe-db-connector)
```

###  Alternatives

[doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.

9.7k578.4M5.6k](/packages/doctrine-dbal)[ifsnop/mysqldump-php

PHP version of mysqldump cli that comes with MySQL

1.3k5.5M69](/packages/ifsnop-mysqldump-php)[clouddueling/mysqldump-php

PHP version of mysqldump cli that comes with MySQL

1.3k22.9k](/packages/clouddueling-mysqldump-php)[druidfi/mysqldump-php

PHP version of mysqldump cli that comes with MySQL

35489.8k6](/packages/druidfi-mysqldump-php)[popphp/pop-db

Pop Db Component for Pop PHP Framework

1814.6k11](/packages/popphp-pop-db)[riverside/php-orm

PHP ORM micro-library and query builder

111.2k](/packages/riverside-php-orm)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
