Skip to content

Instantly share code, notes, and snippets.

@chukShirley
Created November 9, 2015 04:22
Show Gist options
  • Save chukShirley/dd163fd5d8654618be26 to your computer and use it in GitHub Desktop.
Save chukShirley/dd163fd5d8654618be26 to your computer and use it in GitHub Desktop.
ZF2 DB2 configuration
<?php
$env = getenv('APPLICATION_ENV');
return [
// modules, module listener options, etc.
'config_glob_paths' => [
__DIR__.'/autoload/{,*.}{global,'.$env.',local}.php',
]
]l
<?php
// config/autoload/db.development.php
ini_set('error_log', '/usr/local/zendsvr6/var/log/php-dev.log');
ini_set('error_reporting', E_ALL);
return [
'db' => [
'username' => 'WEBTEST',
'password' => 'WEBTEST',
'driver_options' => [
'db2_attr_case' => DB2_CASE_UPPER,
'i5_libl' => 'TESTLIB1 TESTLIB2'
]
]
];
<?php
// config/autoload/db.production.php
return [
'db' => [
'username' => 'WEBUSER',
'password' => 'WEBUSER',
'driver_options' => [
'i5_libl' => 'PRODLIB1 PRODLIB2'
]
]
];
<?php
// config/autoload/global.php
return [
'db' => [
'driver' => 'IbmDb2',
'platform' => 'IbmDb2',
'platform_options' => [
'quote_identifiers' => true,
],
'persistent' => true,
'database' => 'S1234567', // Look up value with WRKRDBDIRE
'driver_options' => [
'i5_naming' => DB2_I5_NAMING_ON,
]
],
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment