如何在SlimPHP中使用DB2中的学说?

时间:2016-09-23 19:56:21

标签: doctrine-orm db2 slim

我正在尝试在Slim中使用Doctrine连接到DB2数据库。我没有错。但是,我的应用程序没有连接到数据库。我正在使用(可能不正确)此驱动程序包:alanseiden / doctrine-dbal-ibmi

以下是我DIC的相关内容:

// Doctrine
$container['db'] = function ($c) {
$settings = $c->get('settings');
$config = \Doctrine\ORM\Tools\Setup::createAnnotationMetadataConfiguration(
    $settings['doctrine']['meta']['entity_path'],
    $settings['doctrine']['meta']['auto_generate_proxies'],
    $settings['doctrine']['meta']['proxy_dir'],
    $settings['doctrine']['meta']['cache'],
    false
);
return \Doctrine\ORM\EntityManager::create($settings['doctrine']['connection'], $config);

};

并且,引用的设置:

        // doctrine settings
    'doctrine' => [
        'meta' => [
            'entity_path' => [
                'app/src/Entity'
            ],
            'auto_generate_proxies' => true,
            'proxy_dir' =>  __DIR__.'/../cache/proxies',
            'cache' => null,
        ],
        'connection' => [
            'Description' => 'IBM i Access ODBC Driver 64-bit',
            'driver'      => '\DoctrineDbalIbmi\Driver\DB2Driver::class',
            'System'      => 'xx.xx.xx.xx',
            'UserID'      => '*****',
            'Password'    => '*****',
            'Naming'      => 0,
            'DefaultLibraries' => 'QGPL',
            'ConnectionType'   => 0,
            'CommitMode'  => 2,
            'ExtendedDynamic' => 1,
            'DefaultPkgLibrary' => 'QGPL',
            'DefaultPackage' => 'A/DEFAULT(IBM),2,0,1,0,512',
            'AllowDataCompression' => 1,
            'MaxFieldLength' => 32,
            'BlockFetch' => 1,
            'BlockSizeKB' => 128,
            'ExtendedColInfo' => 0,
            'LibraryView' => 'ENU',
            'AllowUnsupportedChar' => 0,
            'ForceTranslation' => 0,
            'Trace' => 0
        ]
    ]
],
];

我感谢任何帮助或指导。

0 个答案:

没有答案