PHPackages                             hugsbrugs/php-database - 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. hugsbrugs/php-database

ActiveLibrary

hugsbrugs/php-database
======================

PHP Database Utilities

027PHP

Since Oct 9Pushed 8y ago1 watchersCompare

[ Source](https://github.com/hugsbrugs/php-database)[ Packagist](https://packagist.org/packages/hugsbrugs/php-database)[ RSS](/packages/hugsbrugs-php-database/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependenciesVersions (1)Used By (0)

php-database
------------

[](#php-database)

This library provides utilities function to ease MySql databse connections

```
composer require hugsbrugs/php-database

```

Create a config.ini file

```
[mysql database]
MYSQL_DB_HOST = 'localhost'
MYSQL_DB_PORT = 3306
MYSQL_DB_USER = 'username'
MYSQL_DB_PASS = 'password'
MYSQL_DB_NAME = 'database_name'
MYSQL_DB_ENV = 'dev';'prod'

[sqllite database]
SQLLITE_DB_PATH = '/PATH_TO/sqllite'
SQLLITE_DB_USER = ''
SQLLITE_DB_PASS = ''
SQLLITE_DB_NAME = 'garden'
SQLLITE_DB_ENV = 'dev';'prod'

```

Create a php file

```
require_once __DIR__ . '/config.php';
require_once __DIR__ . '/../vendor/autoload.php';

use Hug\Database\MySqlDB as MySqlDB;

# Use constants defined in config.ini to get default db
$db = MySqlDB::getInstance();
list_tables($db1);

# Or pass params
$db = MySqlDB::getInstance(
	$host = 'localhost',
	$port = 3306,
	$user = 'username',
	$pass = 'password',
	$name = 'database_name',
	$env = 'dev'
);

```

Have a look at example folder for full working code.

Author
------

[](#author)

Hugo Maugey [visit my website ;)](https://hugo.maugey.fr)

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/cc04033020c3e5219ac30edf7d7362952e88ea64a0de2f41b89559f849f09901?d=identicon)[hugsbrugs](/maintainers/hugsbrugs)

---

Top Contributors

[![hugsbrugs](https://avatars.githubusercontent.com/u/4385090?v=4)](https://github.com/hugsbrugs "hugsbrugs (6 commits)")

### Embed Badge

![Health badge](/badges/hugsbrugs-php-database/health.svg)

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

PHPackages © 2026

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