williarin/wordpress-interop-bundle

Symfony 扩展包,用于将 williarin/wordpress-interop 集成到框架中

1.3.0 2024-03-28 17:37 UTC

This package is auto-updated.

Last update: 2024-08-28 18:26:39 UTC


README

简介

此扩展包将 williarin/wordpress-interop 与 Symfony 集成。

安装

composer require williarin/wordpress-interop-bundle

配置

# config/packages/doctrine.yaml
doctrine:
    dbal:
        connections:
            my_dbal_connection:
                driver: pdo_mysql
                url: '%env(resolve:WORDPRESS_DATABASE_URL)%'
                charset: UTF8
# config/packages/williarin_wordpress_interop.yaml
williarin_wordpress_interop:
    # default_entity_manager:  # defaults to the first defined entity manager
    entity_managers:
        my_entity_manager:
            connection: my_dbal_connection
            # tables_prefix: custom_ # defaults to 'wp_'
            
        # another_manager:
        #     connection: my_other_dbal_connection
        #     # tables_prefix: custom_

自动装配

  • Williarin\WordpressInterop\ManagerRegistryInterface 用于访问所有您的管理器和存储库。
  • Williarin\WordpressInterop\EntityManagerInterface 用于获取默认实体管理器
  • Williarin\WordpressInterop\Persistence\DuplicationServiceInterface 用于获取默认重复服务
  • wordpress_interop.entity_manager 作为 Williarin\WordpressInterop\EntityManagerInterface 的替代

许可

MIT

版权(c)2022,William Arin