Skip to content

Instantly share code, notes, and snippets.

@srayner
Created June 21, 2012 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save srayner/2968225 to your computer and use it in GitHub Desktop.
Save srayner/2968225 to your computer and use it in GitHub Desktop.
$dbParams = array(
'database' => 'zf2tutorial',
'username' => 'root',
'password' => 'sr.256%',
'hostname' => '127.0.0.1',
);
return array(
'service_manager' => array(
'factories' => array(
'Zend\Db\Adapter\Adapter' => function ($sm) use ($dbParams) {
return new Zend\Db\Adapter\Adapter(array(
'driver' => 'pdo',
'dsn' => 'mysql:dbname='.$dbParams['database'].';host='.$dbParams['hostname'],
'database' => $dbParams['database'],
'username' => $dbParams['username'],
'password' => $dbParams['password'],
'hostname' => $dbParams['hostname'],
));
},
),
),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment