PHPackages                             otis22/cleardb-url - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. otis22/cleardb-url

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

otis22/cleardb-url
==================

Clear-db-url parser.

1.0.0(4y ago)118MITPHP

Since Dec 28Pushed 4y ago1 watchersCompare

[ Source](https://github.com/otis22/cleardb-url)[ Packagist](https://packagist.org/packages/otis22/cleardb-url)[ RSS](/packages/otis22-cleardb-url/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

otis22/cleardb-url
==================

[](#otis22cleardb-url)

Clear-db-url parser. [Cleardb](https://www.cleardb.com/) is a db as service. Useful for heroku users.

[![GitHub CI](https://github.com/otis22/cleardb-url/workflows/CI/badge.svg)](https://github.com/otis22/cleardb-url/workflows/CI/badge.svg)[![Autofix](https://github.com/otis22/cleardb-url/workflows/AUTOFIX/badge.svg)](https://github.com/otis22/cleardb-url/workflows/AUTOFIX/badge.svg)[![Coverage Status](https://camo.githubusercontent.com/eb5742f9e1aa0046cf016fba191ec0b679d0ba56e9de984dcf1f66bb49b099c8/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6f74697332322f636c65617264622d75726c2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/otis22/cleardb-url?branch=master)

### How to use

[](#how-to-use)

Install package

```
composer require otis22/cleardb-url
```

For heroku users
----------------

[](#for-heroku-users)

Heroku server put clearDb url to environments. This function use env with name CLEARDB\_DATABASE\_URL.

```
use function Otis22\ClearDb\credential;

$credential = credential();

$credential->db(); #db name
$credential->driver(); #db type(mysql, pgsql, ...)
$credential->host(); #host
$credential->pass(); #password
$credential->user(); #user
```

### For phinx on heroku

[](#for-phinx-on-heroku)

```
use function Otis22\ClearDb\phinx;

return
[
...
    'environments' => [
        'default_migration_table' => 'phinxlog',
        'default_environment' => 'production',
        'production' => phinx()->asArray()
    ],
...
```

### Parse custom clearDb url

[](#parse-custom-cleardb-url)

```
use Otis22\ClearDb\ParsedUrl;
use Otis22\ClearDb\Credential;

$credential = new Credential(
    new ParsedUrl('mysql://user:pass@host/dbname?reconnect=true')
);
# Available for getting db credentials
$credential->db();
...
```

Contributing
------------

[](#contributing)

For run all tests

```
make all
```

or connect to terminal

```
make exec
```

or use built in php server

```
# start server on 8080 port
make serve
# custom port 8081
make serve PORT=8081
```

*Dafault php version is 7.4*. Use PHP\_VERSION= for using custom version.

```
make all PHP_VERSION=8.0
# run both
make all PHP_VERSION=7.4 && make all PHP_VERSION=8.0
```

all commands

```
# composer install
make install
# composer install with --no-dev
make install-no-dev
# check code style
make style
# fix code style
make style-fix
# run static analyze tools
make static-analyze
# run unit tests
make unit
#  check coverage
make coverage
```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1649d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/61097a8108512dbb04c61cea2c5e2291b31dacc2404e882b2aa12688e587b088?d=identicon)[vromanichev](/maintainers/vromanichev)

---

Top Contributors

[![otis22](https://avatars.githubusercontent.com/u/378373?v=4)](https://github.com/otis22 "otis22 (13 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleECS

Type Coverage Yes

### Embed Badge

![Health badge](/badges/otis22-cleardb-url/health.svg)

```
[![Health](https://phpackages.com/badges/otis22-cleardb-url/health.svg)](https://phpackages.com/packages/otis22-cleardb-url)
```

###  Alternatives

[arcanedev/support

ARCANEDEV Support Helpers

1908.5M78](/packages/arcanedev-support)[phalcongelist/php-diff

A comprehensive library for generating differences between two hashable objects (strings or arrays).

12435.6k2](/packages/phalcongelist-php-diff)[thrace/datagrid-bundle

This bundle provides easy creating of jqGrid datagrids

186.2k4](/packages/thrace-datagrid-bundle)

PHPackages © 2026

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