diablomedia / doctrine1-bundle
Symfony Doctrine1Bundle
1.1.2
2024-05-20 21:26 UTC
Requires
- php: ~8.1 || ~8.2
- doctrine/doctrine1: ^1.2.0
- doctrine/sql-formatter: ^1.0.1
- symfony/cache: ^5.4 || ^6.0 || ^7.0
- symfony/config: ^5.4 || ^6.0 || ^7.0
- symfony/console: ^5.4 || ^6.0 || ^7.0
- symfony/dependency-injection: ^5.4 || ^6.0 || ^7.0
- symfony/framework-bundle: ^5.4 || ^6.0 || ^7.0
- symfony/service-contracts: ^1.1.1 || ^2.0 || 3.0
Requires (Dev)
- diablomedia/php-cs-fixer-config: ^2.1.0
- friendsofphp/php-cs-fixer: ^3.20.0
- phpstan/phpstan: 1.11.1
- psalm/plugin-symfony: ^2.2.4
- symfony/property-info: ^4.3.3 || ^5.0 || ^6.0 || ^7.0
- symfony/proxy-manager-bridge: ^5.4 || ^6.0 || ^7.0
- symfony/twig-bridge: ^5.4 || ^6.0 || ^7.0
- symfony/validator: ^5.4 || ^6.0 || ^7.0
- symfony/web-profiler-bundle: ^5.4 || ^6.0 || ^7.0
- symfony/yaml: ^5.4 || ^6.0 || ^7.0
- twig/twig: ^1.34 || ^2.12 || ^3.0
- vimeo/psalm: 4.30.0
Suggests
- symfony/web-profiler-bundle: To use the data collector.
- dev-main
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.0
- dev-dependabot/composer/phpstan/phpstan-1.11.11
- dev-dependabot/github_actions/shivammathur/setup-php-2.31.1
- dev-dependabot/github_actions/actions/checkout-4.1.7
- dev-dependabot/composer/diablomedia/php-cs-fixer-config-tw-3.0.0
- dev-dependabot/composer/psalm/plugin-symfony-tw-4.0.4
This package is auto-updated.
Last update: 2024-09-19 20:33:39 UTC
README
Symfony Bundle for Doctrine1 ORM
此包基于 Symfony/Doctrine DoctrineBundle (https://github.com/doctrine/DoctrineBundle),但进行了适配以支持 Doctrine1。此包允许您通过 Symfony 的配置来配置 Doctrine1,并且还在 Symfony 控制台调试工具栏中添加了一个部分,以便您可以以与 DoctrineBundle 相同的方式查看查询信息。
安装
使用 composer 安装
composer require diablomedia/doctrine1-bundle
尽管此包应该与原始 Doctrine1 库兼容,但我们推荐使用我们改进的版本,该版本针对最近的 PHP 版本进行了更好的测试。
composer require diablomedia/doctrine1
配置
在 Symfony 中启用此 Bundle
<?php // config/bundles.php return [ // ... DiabloMedia\Bundle\Doctrine1Bundle\Doctrine1Bundle::class => ['all' => true], // ... ];
要配置数据库连接,在您的 config/packages
文件夹中创建一个 doctrine1.yaml
文件,并包含必要的连接凭据,以下是一个 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