PHPackages                             simbiat/db-installer - 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. simbiat/db-installer

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

simbiat/db-installer
====================

Install database dependencies for a library based on the current version.

001PHP

Since Apr 27Pushed 2mo agoCompare

[ Source](https://github.com/Simbiat/db-installer)[ Packagist](https://packagist.org/packages/simbiat/db-installer)[ RSS](/packages/simbiat-db-installer/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (1)

DB Installer
============

[](#db-installer)

Small library to install or update database dependencies of a library, based on its current version.

```
new \Simbiat\Database\Installer($dbh)::install(string $pattern, string $version = '0.0.0', string $replace_string = '', string $replace_with = '')
```

The constructor of the `Installer` class requires a `\PDO` object to establish connection, or it can be or `null` if you are using [DB Pool](https://github.com/Simbiat/db-pool) library.

Then pass a pattern for `glob()` to get the files with SQL commands you need to run and current `version` string. The function will scan the respective folder(s) for files and then compare their names to the version provided. Those files that have a "greater" version number (based on `version_compare()`) will be concatenated and then run against the database. If the commands succeed, the function will return `true`, otherwise an exception will be thrown.

You can also pass `$replace_string` and `$replace_with` that will `preg_replace()` in the resulting set of queries. This is useful if you need to customize a database prefix, for example.

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance57

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 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://avatars.githubusercontent.com/u/6022665?v=4)[Dmitrii Kustov](/maintainers/Simbiat)[@Simbiat](https://github.com/Simbiat)

---

Top Contributors

[![Simbiat](https://avatars.githubusercontent.com/u/6022665?v=4)](https://github.com/Simbiat "Simbiat (1 commits)")

### Embed Badge

![Health badge](/badges/simbiat-db-installer/health.svg)

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

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k117.2M117](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

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