Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $database = "BLUDB";
- $user = "dashdb_user";
- $password = "dashdb_passwd";
- $hostname = "dashdb_host";
- $port = 50000;
- return array(
- 'db' => array(
- 'driver' => 'Pdo',
- 'dsn' => 'mysql:dbname=mysql_db;host=localhost',
- 'driver_options' => array(
- PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES 'UTF8''
- ),
- 'adapters'=>array(
- 'db2' => array(
- 'driver' => 'IbmDb2',
- 'database' => "DRIVER = { IBM DB2 ODBC DRIVER }; DATABASE = $database; HOSTNAME=$hostname; PORT = $port; PROTOCOL = TCPIP ; UID = $user ; PWD = $password;",
- ),
- )
- ),
- return array(
- 'db' => array(
- // for primary db adapter that called
- // by $sm->get('ZendDbAdapterAdapter')
- 'username' => 'mysql_username',
- 'password' => mysql_passwd',
- // to allow other adapter to be called by
- // $sm->get('db1') based on the adapters config.
- 'adapters' => array(
- 'db2' => array(
- 'username' => 'dashdb_user',
- 'password' => 'dashdb_passwd',
- ),
- ),
- ),
- );
- public function onBootstrap(MvcEvent $e)
- {
- $eventManager = $e->getApplication()->getEventManager();
- $moduleRouteListener = new ModuleRouteListener();
- $moduleRouteListener->attach($eventManager);
- $sm = $e->getApplication()->getServiceManager();
- $sm->get('db2');
- }
- ( ! ) Fatal error: Uncaught ZendDbAdapterExceptionRuntimeException: The ibm_db2 extension is required by this driver. in F:wampwwwplaydon_websitevendorzendframeworkzend-servicemanagersrcServiceManager.php on line 1130
- ( ! ) ZendServiceManagerExceptionServiceNotCreatedException: An abstract factory could not create an instance of db2(alias: db2). in F:wampwwwplaydon_websitevendorzendframeworkzend-servicemanagersrcServiceManager.php on line 1130
- Call Stack
- # Time Memory Function Location
- 1 0.0303 357304 {main}( ) ...index.php:0
- 2 0.5798 867056 ZendMvcApplication::init( ) ...index.php:17
- 3 3.4846 3664936 ZendMvcApplication->bootstrap( ) ...Application.php:281
- 4 3.8506 4129480 ZendEventManagerEventManager->triggerEvent( ) ...Application.php:169
- 5 3.8506 4129480 ZendEventManagerEventManager->triggerListeners( ) ...EventManager.php:251
- 6 4.3917 4660464 call_user_func:{F:wampwwwplaydon_websitevendorzendframeworkzend-eventmanagersrcEventManager.php:490} ( ) ...EventManager.php:490
- 7 4.3917 4660464 ApplicationModule->onBootstrap( ) ...EventManager.php:490
- 8 4.4072 4670080 ZendServiceManagerServiceManager->get( ) ...Module.php:33
- 9 4.4073 4670600 ZendServiceManagerServiceManager->create( ) ...ServiceManager.php:530
- 10 4.4073 4670600 ZendServiceManagerServiceManager->doCreate( ) ...ServiceManager.php:597
- 11 4.4073 4670600 ZendServiceManagerServiceManager->createFromAbstractFactory( )
Add Comment
Please, Sign In to add comment