thephpeffect/connection-manager

A simple connection manager for any OOP db connection in PHP

Installs: 12

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/thephpeffect/connection-manager

v1.0 2015-09-23 00:05 UTC

This package is not auto-updated.

Last update: 2025-12-04 06:27:00 UTC


README

A PHP singleton designed to keep track of multiple database connections.

Installation

The recommended way to install ConnectionManager is through composer(https://getcomposer.org/). Type the following command in your shell environment:

php ~/composer.phar require thephpeffect/connection-manager

Usage

The "default" connection can be accessed by the db() function without passing a connection name.

db("default", new mysqli(...));
db("stats", new PDO(...));

$result = db()->query("SELECT * FROM table1");
$statement = db("stats")->prepare("SELECT * FROM table1 WHERE a=? AND b=?");