Download the PHP package tourze/doctrine-dedicated-connection-bundle without Composer

On this page you can find all versions of the php package tourze/doctrine-dedicated-connection-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package doctrine-dedicated-connection-bundle

Doctrine Dedicated Connection Bundle

这个 Bundle 提供了一种简单的方式来为 Symfony 服务创建专用的数据库连接,类似于 MonologBundle 的 WithMonologChannel 功能。专注于连接管理,不涉及 EntityManager。

功能特性

安装

使用方法

使用注解方式

使用 WithDedicatedConnection 注解标记服务:

使用标签方式

环境变量配置

每个连接支持通过环境变量覆盖配置:

如果没有设置 {CHANNEL}_DB_NAME,将使用默认数据库名称加上 _channel 后缀。

注解参数

WithDedicatedConnection 注解只有一个参数:

所有的数据库配置都通过环境变量管理,确保配置的一致性和可维护性。

高级用法

在自定义 CompilerPass 中创建连接

如果你需要在自己的 CompilerPass 中创建专用连接,可以使用 DedicatedConnectionHelper

直接使用工厂服务

获取特定的连接

创建的服务遵循以下命名约定:

最佳实践

  1. 使用有意义的通道名称:使用描述性的名称如 orderanalyticsarchive
  2. 按业务领域分离数据:每个微服务或业务领域使用独立的数据库
  3. 配置环境变量:在生产环境中使用环境变量配置敏感信息
  4. 连接重用:如果多个服务需要同一个专用连接,使用相同的 channel 名称

故障排除

连接无法建立

确保:

许可证

MIT


All versions of doctrine-dedicated-connection-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
doctrine/dbal Version ^4.0
doctrine/doctrine-bundle Version ^2.13
doctrine/orm Version ^3.0
doctrine/persistence Version ^3.1 || ^4
psr/log Version ^3|^2|^1
symfony/config Version ^6.4
symfony/dependency-injection Version ^6.4
symfony/doctrine-bridge Version ^6.4
symfony/framework-bundle Version ^6.4
symfony/http-kernel Version ^6.4
symfony/yaml Version ^6.4 || ^7.1
tourze/bundle-dependency Version 0.0.*
tourze/symfony-runtime-context-bundle Version 0.0.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tourze/doctrine-dedicated-connection-bundle contains the following files

Loading the files please wait ....