PHPackages                             ckuran/doctrine4legacy - 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. ckuran/doctrine4legacy

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

ckuran/doctrine4legacy
======================

Simple Doctrine wrapper for legacy apps.

v1.0.12(6y ago)03.8k1MITPHPPHP ^5.6 || ^7.0 || ^7.1 || ^7.2

Since Jul 16Pushed 6y agoCompare

[ Source](https://github.com/ckuran/doctrine4legacy)[ Packagist](https://packagist.org/packages/ckuran/doctrine4legacy)[ Docs](https://github.com/ckuran/doctrine4legacy)[ RSS](/packages/ckuran-doctrine4legacy/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (4)Versions (15)Used By (0)

Doctrine4Legacy
===============

[](#doctrine4legacy)

Simple wrapper for both Doctrine's DBAL and ORM for legacy apps.
----------------------------------------------------------------

[](#simple-wrapper-for-both-doctrines-dbal-and-orm-for-legacy-apps)

Every day I have to work with legacy PHP 5.6 monolithic apps based on the custom-made framework. If you have some experience with Doctrine in Symfony framework, then you probably know how Doctrine's EntityManager eases the daily dev's life by simplifying everything.

This library provides a simple wrapper, so you can focus on developing your legacy app - but with the benefit of Doctrine technologies. Use it if you're fed up with your custom framework's DB abstraction level. No more deprecated mysql\_connect errors, notices, warnings etc. Start building your database from the Doctrine CLI. After few years the move to any other proper framework relying on Doctrine will be much less troublesome.

Currently supports:

- Multiple database instances
- DB schema generated from Entities annotations

As a PHP developer I'm still a beginner, but feel free to criticize the code.

How to use?
-----------

[](#how-to-use)

1. Install with Composer

```
composer require ckuran/doctrine4legacy

```

2. Copy .env.dist, cli-config.php to your root directory
3. Rename .env.dist to .env
4. Edit .env file and provide the access to a single or multiple databases via custom prefixes
5. Create bootstrap.php file in your script or include this code somewhere near loading the composer dependencies

```
define('ROOT', __DIR__ . '/');

if (file_exists(ROOT . '.env')) {
    $env = new Dotenv();
    $env->load(ROOT . '.env');
}
```

6. You can add the wrappers to bootstrap.php or use it anywhere in your script:

Obtain the default DB with:

```
$em   = DoctrineWrapper::getEntityManager();
$dbal = DoctrineWrapper::getConnection();
```

Obtain custom prefixed DB with:

```
$em   = DoctrineWrapper::getEntityManager('customPrefix');
$dbal = DoctrineWrapper::getConnection('customPrefix');
```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 84.6% 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 ~56 days

Recently: every ~40 days

Total

13

Last Release

2222d ago

PHP version history (4 changes)v1.0.0PHP ^5.6

v1.0.8PHP ^5.6 || ^7.0

v1.0.9PHP ^5.6 || ^7.0 || ^7.1

v1.0.11PHP ^5.6 || ^7.0 || ^7.1 || ^7.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/29108338?v=4)[Chris K.](/maintainers/ckuran)[@ckuran](https://github.com/ckuran)

---

Top Contributors

[![ckuran](https://avatars.githubusercontent.com/u/29108338?v=4)](https://github.com/ckuran "ckuran (22 commits)")[![walczakmac](https://avatars.githubusercontent.com/u/7500426?v=4)](https://github.com/walczakmac "walczakmac (4 commits)")

---

Tags

doctrinedoctrine-dbaldoctrine-ormphpwrapperdoctrinewrapper

### Embed Badge

![Health badge](/badges/ckuran-doctrine4legacy/health.svg)

```
[![Health](https://phpackages.com/badges/ckuran-doctrine4legacy/health.svg)](https://phpackages.com/packages/ckuran-doctrine4legacy)
```

###  Alternatives

[kimai/kimai

Kimai - Time Tracking

4.8k8.7k1](/packages/kimai-kimai)[bolt/core

🧿 Bolt Core

582145.4k57](/packages/bolt-core)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1175.2k](/packages/rcsofttech-audit-trail-bundle)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.1k16.8k](/packages/prestashop-prestashop)[laravel-doctrine/orm

An integration library for Laravel and Doctrine ORM

8405.5M96](/packages/laravel-doctrine-orm)[oro/platform

Business Application Platform (BAP)

642140.7k104](/packages/oro-platform)

PHPackages © 2026

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