Guest User

Untitled

a guest
Jul 30th, 2016
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.85 KB | None | 0 0
  1. $database = "BLUDB";
  2. $user = "dashdb_user";
  3. $password = "dashdb_passwd";
  4. $hostname = "dashdb_host";
  5. $port = 50000;
  6.  
  7. return array(
  8. 'db' => array(
  9. 'driver' => 'Pdo',
  10. 'dsn' => 'mysql:dbname=mysql_db;host=localhost',
  11. 'driver_options' => array(
  12. PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES 'UTF8''
  13. ),
  14. 'adapters'=>array(
  15. 'db2' => array(
  16. 'driver' => 'IbmDb2',
  17. 'database' => "DRIVER = { IBM DB2 ODBC DRIVER }; DATABASE = $database; HOSTNAME=$hostname; PORT = $port; PROTOCOL = TCPIP ; UID = $user ; PWD = $password;",
  18. ),
  19. )
  20. ),
  21.  
  22. return array(
  23. 'db' => array(
  24. // for primary db adapter that called
  25. // by $sm->get('ZendDbAdapterAdapter')
  26. 'username' => 'mysql_username',
  27. 'password' => mysql_passwd',
  28.  
  29. // to allow other adapter to be called by
  30. // $sm->get('db1') based on the adapters config.
  31. 'adapters' => array(
  32. 'db2' => array(
  33. 'username' => 'dashdb_user',
  34. 'password' => 'dashdb_passwd',
  35. ),
  36. ),
  37. ),
  38. );
  39.  
  40. public function onBootstrap(MvcEvent $e)
  41. {
  42. $eventManager = $e->getApplication()->getEventManager();
  43. $moduleRouteListener = new ModuleRouteListener();
  44. $moduleRouteListener->attach($eventManager);
  45.  
  46. $sm = $e->getApplication()->getServiceManager();
  47. $sm->get('db2');
  48. }
  49.  
  50. ( ! ) Fatal error: Uncaught ZendDbAdapterExceptionRuntimeException: The ibm_db2 extension is required by this driver. in F:wampwwwplaydon_websitevendorzendframeworkzend-servicemanagersrcServiceManager.php on line 1130
  51. ( ! ) ZendServiceManagerExceptionServiceNotCreatedException: An abstract factory could not create an instance of db2(alias: db2). in F:wampwwwplaydon_websitevendorzendframeworkzend-servicemanagersrcServiceManager.php on line 1130
  52. Call Stack
  53. # Time Memory Function Location
  54. 1 0.0303 357304 {main}( ) ...index.php:0
  55. 2 0.5798 867056 ZendMvcApplication::init( ) ...index.php:17
  56. 3 3.4846 3664936 ZendMvcApplication->bootstrap( ) ...Application.php:281
  57. 4 3.8506 4129480 ZendEventManagerEventManager->triggerEvent( ) ...Application.php:169
  58. 5 3.8506 4129480 ZendEventManagerEventManager->triggerListeners( ) ...EventManager.php:251
  59. 6 4.3917 4660464 call_user_func:{F:wampwwwplaydon_websitevendorzendframeworkzend-eventmanagersrcEventManager.php:490} ( ) ...EventManager.php:490
  60. 7 4.3917 4660464 ApplicationModule->onBootstrap( ) ...EventManager.php:490
  61. 8 4.4072 4670080 ZendServiceManagerServiceManager->get( ) ...Module.php:33
  62. 9 4.4073 4670600 ZendServiceManagerServiceManager->create( ) ...ServiceManager.php:530
  63. 10 4.4073 4670600 ZendServiceManagerServiceManager->doCreate( ) ...ServiceManager.php:597
  64. 11 4.4073 4670600 ZendServiceManagerServiceManager->createFromAbstractFactory( )
Add Comment
Please, Sign In to add comment