PHPackages                             divineomega/php-dcom - 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. divineomega/php-dcom

Abandoned → [jord-jd/php-dcom](/?search=jord-jd%2Fphp-dcom)Library[Database &amp; ORM](/categories/database)

divineomega/php-dcom
====================

PHP Database Connection Object Manager

v3.0.1(2mo ago)1446↓100%[1 issues](https://github.com/Jord-JD/php-dcom/issues)LGPL-3.0-onlyPHPPHP &gt;=5.5.9

Since Jan 13Pushed 2mo agoCompare

[ Source](https://github.com/Jord-JD/php-dcom)[ Packagist](https://packagist.org/packages/divineomega/php-dcom)[ Docs](https://github.com/Jord-JD/php-dcom)[ GitHub Sponsors](https://github.com/DivineOmega)[ RSS](/packages/divineomega-php-dcom/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)DependenciesVersions (10)Used By (0)

PHP DCOM
========

[](#php-dcom)

The PHP DCOM (Database Connection Object Manager) is designed to allow easy management of multiple database connection objects. It stores database connection details within a `.env`file in the root of your project.

Installation
------------

[](#installation)

Simple run `composer require jord-jd/php-dcom` to install.

You will need to set environment variables to use this library. If you are not using a framework that allows you to set these easily, you can install the `dotenv-loader`package which will immediately allow do so via a `.env` file.

To install `dotenv-loader`, just run: `composer require jord-jd/dotenv-loader`.

Usage
-----

[](#usage)

These usage instructions assume you are able to set environment variables via a `.env`file. If needed, create a `.env` file in the root of your project (alongside your `composer.json` file). This will be used to store you database connection details, in the following format.

```
DCOM_MAIN_OBJECT_TYPE=mysqli
DCOM_MAIN_DATABASE_TYPE=mysql

DCOM_MAIN_DATABASE_HOST=localhost
DCOM_MAIN_DATABASE_USERNAME=username
DCOM_MAIN_DATABASE_PASSWORD=password
DCOM_MAIN_DATABASE_NAME=testdb

```

DCOM supports the creation of both `mysqli` and `pdo` objects.

After setting up your `.env` file, you can then establish a connection to the database, as shown below. DCOM will ensure your application only uses a single connection to each database per request.

```
require 'vendor/autoload.php';

use \JordJD\DCOM\DCOM;

$mysqli = DCOM::getConnection("main");
```

Note that the connection name passed to the `getConnection` method matches what is defined in the `.env` file. You can therefore change this argument in order to manage and connect to multiple databases easily.

Example
-------

[](#example)

For an actual example of how to use PHP DCOM, see the [`test` directory](test/).

###  Health Score

42

—

FairBetter than 89% of packages

Maintenance70

Regular maintenance activity

Popularity15

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity64

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 ~415 days

Recently: every ~802 days

Total

9

Last Release

83d ago

Major Versions

v1.2.2 → v2.0.02026-02-14

v2.0.0 → v3.0.02026-02-14

### Community

Maintainers

![](https://www.gravatar.com/avatar/c580cdf7c14898fff179cdfc1085892091d5d2f49d917873a12365af9ac77c93?d=identicon)[Jord-JD](/maintainers/Jord-JD)

---

Top Contributors

[![Jord-JD](https://avatars.githubusercontent.com/u/650645?v=4)](https://github.com/Jord-JD "Jord-JD (8 commits)")

---

Tags

database-connectionmysqlipdophp-libraryphpdatabasepdomysqliPHP Librarydatabase connectionsdatabase connection PHP library

### Embed Badge

![Health badge](/badges/divineomega-php-dcom/health.svg)

```
[![Health](https://phpackages.com/badges/divineomega-php-dcom/health.svg)](https://phpackages.com/packages/divineomega-php-dcom)
```

###  Alternatives

[clouddueling/mysqldump-php

PHP version of mysqldump cli that comes with MySQL

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

An advanced, compact and lightweight MySQL database wrapper library, built around PHP's MySQLi extension.

11812.0k](/packages/stefangabos-zebra-database)[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)
