ezsystems/doctrine-dbal-schema
Composer 安装命令:
composer require ezsystems/doctrine-dbal-schema
包简介
Abstraction layer, on top of Doctrine, for cross-DBMS schema import
README 文档
README
This Symfony Bundle provides basic abstraction layer for cross-DBMS schema import.
It introduces custom Yaml format for schema definition and provides autowired APIs.
Schema Builder
Provided by APIs defined on the \EzSystems\DoctrineSchema\API\SchemaImporter interface,
imports given Yaml source string or Yaml file into \Doctrine\DBAL\Schema object.
Schema Exporter
Provided by APIs defined on the \EzSystems\DoctrineSchema\API\SchemaExporter interface,
exports given \Doctrine\DBAL\Schema object to the custom Yaml format.
SchemaBuilder
Provided by APIs defined on the \EzSystems\DoctrineSchema\API\Builder\SchemaBuilder interface,
is an extensibility point to be used by Symfony-based projects.
The SchemaBuilder is event-driven. To hook into the process of building schema, a custom EventSubscriber is required, e.g.
use EzSystems\DoctrineSchema\API\Event\SchemaBuilderEvent; use EzSystems\DoctrineSchema\API\Event\SchemaBuilderEvents; use Symfony\Component\EventDispatcher\EventSubscriberInterface; class BuildSchemaSubscriber implements EventSubscriberInterface { /** * @var string */ private $schemaFilePath; public function __construct(string $schemaFilePath) { $this->schemaFilePath = $schemaFilePath; } /** * Returns an array of events this subscriber wants to listen to. * * @return string[] */ public static function getSubscribedEvents() { return [ SchemaBuilderEvents::BUILD_SCHEMA => ['onBuildSchema', 200], ]; } /** * @param \EzSystems\DoctrineSchema\API\Builder\SchemaBuilderEvent $event */ public function onBuildSchema(SchemaBuilderEvent $event) { $event ->getSchemaBuilder() ->importSchemaFromFile($this->schemaFilePath); } }
Schema provided in this way can be imported into Schema object by e.g.:
public function __construct(SchemaBuilder $schemaBuilder) { $this->schemaBuilder = $schemaBuilder; } public function importSchema() { $schema = $this->schemaBuilder->buildSchema(); // ... }
COPYRIGHT
Copyright (C) 1999-2021 Ibexa AS (formerly eZ Systems AS). All rights reserved.
LICENSE
This source code is available separately under the following licenses:
A - Ibexa Business Use License Agreement (Ibexa BUL), version 2.4 or later versions (as license terms may be updated from time to time) Ibexa BUL is granted by having a valid Ibexa DXP (formerly eZ Platform Enterprise) subscription, as described at: https://www.ibexa.co/product For the full Ibexa BUL license text, please see: https://www.ibexa.co/software-information/licenses-and-agreements (latest version applies)
AND
B - GNU General Public License, version 2 Grants an copyleft open source license with ABSOLUTELY NO WARRANTY. For the full GPL license text, please see: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
ezsystems/doctrine-dbal-schema 适用场景与选型建议
ezsystems/doctrine-dbal-schema 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 833.32k 次下载、GitHub Stars 达 30, 最近一次更新时间为 2019 年 02 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 ezsystems/doctrine-dbal-schema 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ezsystems/doctrine-dbal-schema 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 833.32k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 30
- 点击次数: 30
- 依赖项目数: 36
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-only
- 更新时间: 2019-02-22