Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Doctrine1 Laravel Package

doctrine/doctrine1

Legacy Doctrine 1 ORM for PHP, providing ActiveRecord and Data Mapper features with a SQL abstraction layer, migrations, schema tools, and powerful query building. Useful for maintaining older Doctrine 1 applications or studying the classic ORM API.

View on GitHub
Deep Wiki
Context7

PHP 5 Doctrine1 Object Relational Mapper (ORM)

Frequently asked questions about Doctrine1
Can I use doctrine/doctrine1 in Laravel 5/6/7/8/9 for new development?
No, this package is designed for Laravel 3/4 or standalone PHP 5.2–5.6 projects. Laravel 5+ relies on Eloquent or Doctrine2, and Doctrine1 lacks native integration with Laravel’s service container, facades, or Artisan. Attempting to use it in modern Laravel will require heavy custom workarounds and introduces security risks due to its abandoned status.
What’s the difference between Doctrine1 and Doctrine2 in terms of Laravel compatibility?
Doctrine1 uses `Doctrine_Core` and `Doctrine_Query` APIs, while Doctrine2 (via `doctrine/dbal` or `doctrine/orm`) aligns with Laravel’s dependency injection and PSR standards. Doctrine2 supports Laravel’s Eloquent-like syntax and migrations natively, whereas Doctrine1 requires manual integration or isolation (e.g., microservices). Doctrine2 is actively maintained; Doctrine1 is deprecated since 2012.
How do I install doctrine/doctrine1 in a Laravel 3/4 project?
Add it via Composer: `composer require doctrine/doctrine1`. For Laravel 3/4, ensure your `composer.json` targets PHP 5.2–5.6 and autoloads the `Doctrine` namespace. Configure the Doctrine connection in `application/config/doctrine.php` (if using Laravel’s legacy Doctrine bundle). Note: This package is **not** compatible with Laravel’s modern autoloader (PSR-4) without manual overrides.
Does doctrine/doctrine1 support Laravel’s migrations system?
No, Doctrine1’s schema tooling (`doctrine:build`) conflicts with Laravel Migrations. You’ll need to manually synchronize changes or use a hybrid approach (e.g., generate Doctrine1 schemas first, then adapt them for Laravel’s `migrate:status`). For new projects, Laravel Migrations + Eloquent/Doctrine2 is the recommended path.
Are there security risks using doctrine/doctrine1 in production?
Yes, Doctrine1 is abandoned and lacks patches for PHP 7+/8.x vulnerabilities, including SQL injection risks via raw DQL or deserialization flaws in legacy Doctrine_Core. Avoid using it in production unless isolated in a containerized microservice with strict input validation. Modern alternatives (Eloquent, Doctrine2) include active security updates.
Can I migrate from Doctrine1 to Eloquent in Laravel 5+?
Migration is complex but possible. Start by converting `Doctrine_Record` models to Eloquent with `@property` annotations for legacy fields. Replace `Doctrine_Query` with Eloquent’s Query Builder or raw queries. Use tools like `phpstan` to analyze dependencies, then incrementally replace queries and relationships. Schema changes may require manual alignment between Doctrine1-generated tables and Laravel Migrations.
How do I handle Doctrine1’s PHP 5.2–5.6 dependency in a modern Laravel app?
Isolate Doctrine1 in a separate PHP 5.6 container (e.g., Docker) and expose it via REST/gRPC to your Laravel app. Avoid mixing PHP versions in the same project, as Composer autoloading and Laravel’s service container will conflict. For temporary compatibility, use `composer.json` overrides or custom classmaps, but this is not sustainable long-term.
What alternatives exist for legacy Doctrine1 applications in Laravel?
For Laravel 5+, replace Doctrine1 with Eloquent (built-in) or Doctrine2 (`doctrine/orm`). If tied to a third-party plugin, check if it offers a Laravel 5+ adapter. For non-Laravel projects, consider migrating to Doctrine2 or a modern ORM like CycleORM. If Doctrine1 is a hard dependency, containerize it and interface via API calls to decouple from your Laravel app.
How do I test a Laravel app that still uses doctrine/doctrine1?
Use PHPUnit with a test database and mock Doctrine1’s core classes (e.g., `Doctrine_Core`, `Doctrine_Query`) where possible. For integration tests, spin up a separate PHP 5.6 environment (e.g., Docker) to avoid conflicts with Laravel’s PHP 7.4+ requirements. Focus on testing business logic layers first, as Doctrine1’s ORM layer is deprecated and unstable.
Will doctrine/doctrine1 work with Laravel’s service container or facades?
No, Doctrine1 lacks PSR-4 autoloading and Laravel’s service container integration. You’d need to manually bind Doctrine1 classes in a custom service provider, e.g., `$this->app->bind('Doctrine_Core', function() { return Doctrine_Core::getTable(); });`. Facades (e.g., `Doctrine::table()`) would require custom facade classes, adding maintenance overhead. This approach is fragile and not recommended for production.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
daikazu/eloquent-salesforce-objects
unseen-codes/chat
romalytar/yammi-jobs-monitoring-laravel
kisame76/filament-db-table-state
nqxcode/laravel-lucene-search
dpfx/laravel-livewire-wizards
workos/workos-php-laravel
sofa/laravel-global-scope
nawasara/auth-primitives
adhocrat-io/arkhe-main
make-dev/orca-harpoon
itsemon245/lamet
baks-dev/dashboard
amoifr/pickle-panther-bundle
make-dev/orca
dmstr/symfony-system-resources-bundle
dmstr/symfony-job-queue-bundle
dmstr/openapi-json-schema-bundle
dmstr/keycloak-security-bundle
dmstr/doctrine-audit-log-bundle