Created
January 13, 2014 12:01
-
-
Save stefanotorresi/8399139 to your computer and use it in GitHub Desktop.
ZF2 ServiceManager config example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return [ | |
'factories' => [ | |
'Db' => function ($sm) { | |
$dbConfig = $sm->get('db_config'); | |
$db = new PDO( | |
$dbConfig['dsn'], | |
$dbConfig['user'], | |
$dbConfig['pass'], | |
$dbConfig['driver_options'] | |
); | |
return $db; | |
}, | |
], | |
'services' => [ | |
'db_config' => [ | |
'dsn' => 'dsn:foo=bar;baz=bat', | |
'user' => 'johndoe', | |
'pass' => 'secret', | |
'driver_options' => [], | |
], | |
], | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment