Permalink
Browse files

[#28] Update README.md Post-Install instructions for new Zend\Db

  • Loading branch information...
1 parent fe6b82e commit 53738a22e9ae7373d6ae0a6872a788f38e257646 @adamlundrigan adamlundrigan committed Mar 23, 2012
Showing with 32 additions and 6 deletions.
  1. +32 −6 README.md
View
@@ -67,11 +67,22 @@ Coming soon...
### Post-Install: Zend\Db
-1. If you do not already have a PDO connection set up via DI, put the following
+1. If you do not already have a connection set up via DI, put the following
in `./config/autoload/database.config.php`:
<?php
// ./config/autoload/database.config.php
+
+ $mdb = array(
+ 'dbname' => 'CHANGEME',
+ 'user' => 'CHANGEME',
+ 'pass' => 'CHANGEME',
+ 'host' => 'CHANGEME',
+ );
+
+ /**
+ * No need to edit below this line
+ */
return array(
'di' => array(
'instance' => array(
@@ -80,18 +91,33 @@ Coming soon...
),
'masterdb' => array(
'parameters' => array(
- 'dsn' => 'mysql:dbname=CHANGEME;host=CHANGEME',
- 'username' => 'CHANGEME',
- 'passwd' => 'CHANGEME',
+ 'dsn' => "mysql:dbname={$mdb['dbname']};host={$mdb['host']}",
+ 'username' => $mdb['user'],
+ 'passwd' => $mdb['pass'],
'driver_options' => array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\''),
),
),
+ 'Zend\Db\Adapter\Adapter' => array(
+ 'parameters' => array(
+ 'driver' => 'Zend\Db\Adapter\Driver\Pdo\Pdo',
+ ),
+ ),
+ 'Zend\Db\Adapter\Driver\Pdo\Pdo' => array(
+ 'parameters' => array(
+ 'connection' => 'Zend\Db\Adapter\Driver\Pdo\Connection',
+ ),
+ ),
+ 'Zend\Db\Adapter\Driver\Pdo\Connection' => array(
+ 'parameters' => array(
+ 'connectionInfo' => 'masterdb',
+ ),
+ ),
),
),
);
-2. Now, specify the DI alias for your PDO connection in
- `./configs/autoload/module.zfcuser.config.php`, under the 'pdo' setting.
+2. Now, specify the DI alias for your connection in
+ `./configs/autoload/module.zfcuser.config.php`, under the 'zend_db_adapter' setting.
If you created the `./config/autoload/database.config.php` file in the
previous step, the alias you'll specify is 'masterdb'.

0 comments on commit 53738a2

Please sign in to comment.