guidofaecke / doctrine-dbal-ibmi-linux
Doctrine DBAL模块,用于IBM i平台上的DB2,同时使用Linux上的odbc驱动程序
0.2.1
2022-05-23 16:39 UTC
Requires
- php: ^7.4 || ~8.0.0 || ~8.1.0
- ext-odbc: *
Requires (Dev)
- doctrine/dbal: ^3.3
- phpunit/phpunit: ^9.5.0
This package is auto-updated.
Last update: 2024-09-23 21:37:48 UTC
README
我需要一个解决方案,在将应用迁移到Linux服务器的同时,在IBM i上继续使用DB2,并且我只有ODBC。
- 继续使用Doctrine
- 不要花费大量金钱购买IBM的Connect许可证
- 利用ODBC
使用方法
先决条件
对于您的Linux服务器,您需要IBM i Access Client Solutions。您可以在这里找到一份好的指南 -> https://www.ibmsystemsmag.com/Power-Systems/08/2019/ODBC-Driver-for-IBM-i
安装
Composer
$ composer require guidofaecke/doctrine-dbal-ibmi-linux
配置
对于Doctrine本身,只需遵循以下说明 -> https://github.com/DASPRiD/container-interop-doctrine
在您的连接配置中,例如 config/autoload/doctrine.local.php
,使用此特定的 DB2IBMiLinuxDriver
类
<?php return [ 'doctrine' => [ 'connection' => [ 'orm_default' => [ 'driverClass' => \DoctrineDbalIbmiLinux\Driver\DB2IBMiLinuxDriver::class, 'params' => [ 'host' => 'my_host', 'user' => 'my_user', 'password' => 'my_password', 'dbname' => 'my_db', <-- can be found via DSPRDBDIRE or ask your admin 'persistent' => true, 'naming' => 1, <-- 1=system naming, 0=sql naming ], ], ], ], ];
naming
参数基本上决定了您是否使用用户在JOBD中定义的库列表(naming = 1),或者您必须为每个表/实体提供库名称(naming = 0)。
已知问题
我不会提供带有工作单元测试的此软件包。请自行承担风险使用。