diablomedia / doctrine1-bundle
Symfony Doctrine1Bundle
Package info
github.com/diablomedia/doctrine1-bundle
Type:symfony-bundle
pkg:composer/diablomedia/doctrine1-bundle
Requires
- php: ~8.2 || ~8.3 || ~8.4 || ~8.5
- doctrine/doctrine1: ^1.2.0
- doctrine/sql-formatter: ^1.0.1
- symfony/cache: ^7.0 || ^8.0
- symfony/config: ^7.4 || ^8.0
- symfony/console: ^7.4 || ^8.0
- symfony/dependency-injection: ^7.0 || ^8.0
- symfony/framework-bundle: ^7.0 || ^8.0
- symfony/service-contracts: ^1.1.1 || ^2.0 || ^3.0
Requires (Dev)
- diablomedia/php-cs-fixer-config: ^5.0.0
- friendsofphp/php-cs-fixer: ^3.91.2
- phpstan/phpstan: 2.2.16
- phpunit/phpunit: ^11.5.44
- psalm/plugin-symfony: ^5.0.0
- symfony/property-info: ^7.0 || ^8.0
- symfony/proxy-manager-bridge: ^6.0
- symfony/twig-bridge: ^7.0 || ^8.0
- symfony/validator: ^7.0 || ^8.0
- symfony/web-profiler-bundle: ^7.0 || ^8.0
- symfony/yaml: ^7.0 || ^8.0
- twig/twig: ^1.34 || ^2.12 || ^3.0
- vimeo/psalm: 6.14.0
Suggests
- diablomedia/doctrine1: Replacement for doctrine/doctrine1 updated to be compatible with recent php versions
- symfony/web-profiler-bundle: To use the data collector.
Provides
None
Conflicts
- amphp/cache: <2.0.1
- amphp/dns: <2.4.1
- amphp/parser: <1.1.1
- amphp/process: <2.1.0
- amphp/socket: <2.4.1
- daverandom/libdns: <2.1.0
- nikic/php-parser: <5.7.0
- spatie/array-to-xml: <3.4.4
Replaces
None
This package is auto-updated.
Last update: 2026-10-13 17:35:22 UTC
README
Symfony Bundle for Doctrine1 ORM
This is heavily based on the Symfony/Doctrine DoctrineBundle (https://github.com/doctrine/DoctrineBundle) but adapted to work with Doctrine1. This bundle allows you to configure Doctrine1 through Symfony's configuration and also adds a section to the Symfony profiler/debug toolbar so you can view query information in the same way you would with the DoctrineBundle.
Installation
Install using composer:
composer require diablomedia/doctrine1-bundle
While this bundle should work with the original Doctrine1 library, we recommend using our fork that is better tested against recent versions of PHP.
composer require diablomedia/doctrine1
Configuration
Enable the Bundle in Symfony:
<?php // config/bundles.php return [ // ... DiabloMedia\Bundle\Doctrine1Bundle\Doctrine1Bundle::class => ['all' => true], // ... ];
To configure your database connection, create a doctrine1.yaml file in your config/packages folder with the necessary connection credentials, here's a sample for mysql:
doctrine1: default_connection: writer connections: writer: url: '%env(resolve:WRITE_DATABASE_URL)%' cache_class: 'Doctrine_Cache_Array' enable_query_cache: true enable_result_cache: true reader: url: '%env(resolve:READ_DATABASE_URL)%' cache_class: 'Doctrine_Cache_Array' enable_query_cache: true enable_result_cache: true
Generating models
Generate Doctrine 1 models from your YAML schema with:
php bin/console doctrine1:generate-models
By default, the command reads schemas from application/doctrine/schema, writes models to application/models (both relative to the project directory), and uses Doctrine_Record as the base class. It does not require a database connection.
Customize the paths and base class in config/packages/doctrine1.yaml, alongside your connection configuration:
doctrine1: model_generation: schema_path: '%kernel.project_dir%/application/doctrine/schema' models_path: '%kernel.project_dir%/application/models' base_class: Custom_Record
The schema path may point to a YAML file or a directory of schemas. A custom base class must be autoloadable. Doctrine regenerates base models in the output directory's generated subdirectory and preserves existing concrete model files.