Advertisement
TheFan1968

ZF3: DbServiceFactory

Apr 26th, 2017
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.46 KB | None | 0 0
  1. <?php
  2. namespace Kvberlin\Database;
  3.  
  4. class DbServiceFactory implements FactoryInterface
  5. {
  6.  
  7.     public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
  8.     {
  9.        
  10.         //Einlesen der verfügbaren Datenbankverbindungen.
  11.         $config = Factory::fromFile(MODULE_KVBERLIN_ROOT.'/config/db.kvberlin.config.php');
  12.         //Debug::dump($config);
  13.        
  14.         return new DbService($config['db_service']);
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement