定制 kafoso/doctrine-firebird-driver 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kafoso/doctrine-firebird-driver

Composer 安装命令:

composer require kafoso/doctrine-firebird-driver

包简介

README 文档

README

Firebird driver for the Doctrine DBAL.

This library is completely separate (i.e. abstracted away) from the core Doctrine DBAL library. I.e. it is fully a plug-in.

Requirements

To utilize this library in your application code, the following is required:

1 Only needed on remote/guest OS, e.g. a remote Ubuntu server or a VM installed through Docker, Vagrant, or XAMPP.

License & Disclaimer

See LICENSE file. Basically: Use this library at your own risk.

Limitations of Schema Manager

This library does not fully support generation through the Schema Manager, i.e.:

  1. Generation of database tables, views, etc. from entities.
  2. Generation of entities from database tables, views, etc.

Reasons for not investing time in schema generation include that Firebird does not allow renaming of tables, which in turn makes automated schema updates annoying and over-complicated. Better results are probably achieved by writing manual migrations.

Installation

Via Composer (kafoso/doctrine-firebird-driver):

composer install kafoso/doctrine-firebird-driver

Via Github:

git clone git@github.com:kafoso/doctrine-firebird-driver.git

Configuration

Manual configuration

For example of configuration in PHP, see tests/tests/Test/Integration/AbstractIntegrationTest.php (in the method setUp).

Additional help may be found at: https://www.doctrine-project.org/projects/doctrine-orm/en/2.5/reference/advanced-configuration.html

Symfony configuration (YAML)

This driver may be used like any other Doctrine DBAL driver in Symfony. However, the driver_class option must be specified instead of simply driver. This is due to the driver not being part of the core Doctrine DBAL library.

Sample YAML configuration:

doctrine:
    dbal:
        default_connection: default
        connections:
            default:
                driver_class:   Kafoso\DoctrineFirebirdDriver\Driver\FirebirdInterbase\Driver
                host:           "%database_host%"
                port:           "%database_port%"
                dbname:         "%database_name%"
                user:           "%database_user%"
                password:       "%database_password%"
                charset:        "UTF-8"

Tests

Test/development requirements

To run tests, fix bugs, provide features, etc. the following is required:

You may of course install everything manually using your own VM setup. For help and a stack list (required apt-get packages), see the Vagrantfile.

Installation to run tests

A few steps are required to run all tests. Unit tests (tests/tests/Test/Unit) will run on all environments. However, integration tests (tests/tests/Test/Integration) require the following because they test against a running Firebird database in the VM:

  1. vagrant up
    Install/provision the VM.
  2. vagrant ssh
  3. sudo su
  4. apt-get -y install firebird2.5-superclassic
    You will be prompted to install the database using a password. Please provide this password: 88fb9f307125cc397f70e59c749715e1. It is re-used when connecting through the DBAL later on.
  5. dpkg-reconfigure firebird2.5-superclassic
    Starts the Firebird database server. Provide same password as above.

Reference: https://firebirdsql.org/manual/ubusetup.html

Running tests

Due to the database being created by the PHP bootstrap script on the fly, root is needed to run the tests on the VM.

  1. vagrant ssh
  2. sudo su
  3. apt-get install zip -y (for when installing composer packages)
  4. Install composer (on guest OS). Follow these instructions: https://getcomposer.org/download/
  5. mv composer.phar /usr/bin/composer
  6. cd /var/git/kafoso/doctrine-firebird-driver
  7. composer install1
  8. cd /var/git/kafoso/doctrine-firebird-driver/tests
  9. php ../bin/phpunit tests

1 Composer will say you shouldn't run it as root/super user. This is techically true, but it's fine in the VM.

Credits

Authors

Acknowledgements

https://github.com/doctrine/dbal

Fundamental Doctrine DBAL implementation. The driver and platform logic in this library is based on other implementations in the core library, largely \Doctrine\DBAL\Driver\PDOOracle\Driver and \Doctrine\DBAL\Platforms\OraclePlatform, and their respective parent classes.

https://github.com/helicon-os/doctrine-dbal

Whilst a great inspiration for this library - and we very much appreciate the work done by the authors - the library has a few flaws and limitations regarding the Interbase Firebird driver logic:

  • It contains bugs. E.g. incorrect/insufficient handling of nested transactions and save points.
  • It is lacking with respect to test coverage.
  • It appears to no longer be maintained. Possibly entirely discontinued.
  • It is intermingled with the core Doctrine DBAL code, making version management and code adaptation unnecessarily complicated; a nightmare, really. It is forked from https://github.com/doctrine/dbal, although, this is not specifically stated.
  • It is not a Composer package (not on https://packagist.org).

https://github.com/ISTDK/doctrine-dbal

A fork of https://github.com/helicon-os/doctrine-dbal with a few improvements and fixes.

https://firebirdsql.org/

The main resource for Firebird documentation, syntax, downloads, etc.

kafoso/doctrine-firebird-driver 适用场景与选型建议

kafoso/doctrine-firebird-driver 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 13.75k 次下载、GitHub Stars 达 14, 最近一次更新时间为 2018 年 04 月 03 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 kafoso/doctrine-firebird-driver 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 kafoso/doctrine-firebird-driver 我们能提供哪些服务?
定制开发 / 二次开发

基于 kafoso/doctrine-firebird-driver 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 13.75k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 15
  • 点击次数: 3
  • 依赖项目数: 1
  • 推荐数: 1

GitHub 信息

  • Stars: 14
  • Watchers: 3
  • Forks: 17
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-04-03