Skip to content
This repository
Browse code

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

  • Loading branch information...
commit 53738a22e9ae7373d6ae0a6872a788f38e257646 1 parent fe6b82e
Adam Lundrigan authored March 22, 2012

Showing 1 changed file with 32 additions and 6 deletions. Show diff stats Hide diff stats

  1. 38  README.md
38  README.md
Source Rendered
@@ -67,11 +67,22 @@ Coming soon...
67 67
 
68 68
 ### Post-Install: Zend\Db
69 69
 
70  
-1. If you do not already have a PDO connection set up via DI, put the following
  70
+1. If you do not already have a connection set up via DI, put the following
71 71
    in `./config/autoload/database.config.php`:
72 72
 
73 73
         <?php
74 74
         // ./config/autoload/database.config.php
  75
+
  76
+        $mdb = array(
  77
+            'dbname' => 'CHANGEME',
  78
+            'user'   => 'CHANGEME',
  79
+            'pass'   => 'CHANGEME',
  80
+            'host'   => 'CHANGEME',
  81
+        );
  82
+
  83
+        /**
  84
+         * No need to edit below this line 
  85
+         */
75 86
         return array(
76 87
             'di' => array(
77 88
                 'instance' => array(
@@ -80,18 +91,33 @@ Coming soon...
80 91
                     ),
81 92
                     'masterdb' => array(
82 93
                         'parameters' => array(
83  
-                            'dsn'            => 'mysql:dbname=CHANGEME;host=CHANGEME',
84  
-                            'username'       => 'CHANGEME',
85  
-                            'passwd'         => 'CHANGEME',
  94
+                            'dsn'            => "mysql:dbname={$mdb['dbname']};host={$mdb['host']}",
  95
+                            'username'       => $mdb['user'],
  96
+                            'passwd'         => $mdb['pass'],
86 97
                             'driver_options' => array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\''),
87 98
                         ),
88 99
                     ),
  100
+                    'Zend\Db\Adapter\Adapter' => array(
  101
+                        'parameters' => array(
  102
+                            'driver' => 'Zend\Db\Adapter\Driver\Pdo\Pdo',
  103
+                        ),
  104
+                    ),
  105
+                    'Zend\Db\Adapter\Driver\Pdo\Pdo' => array(
  106
+                        'parameters' => array(
  107
+                            'connection' => 'Zend\Db\Adapter\Driver\Pdo\Connection',
  108
+                        ),
  109
+                    ),
  110
+                    'Zend\Db\Adapter\Driver\Pdo\Connection' => array(
  111
+                        'parameters' => array(
  112
+                            'connectionInfo' => 'masterdb',
  113
+                        ),
  114
+                    ),
89 115
                 ),
90 116
             ),
91 117
         );
92 118
 
93  
-2. Now, specify the DI alias for your PDO connection in
94  
-   `./configs/autoload/module.zfcuser.config.php`, under the 'pdo' setting.
  119
+2. Now, specify the DI alias for your connection in
  120
+   `./configs/autoload/module.zfcuser.config.php`, under the 'zend_db_adapter' setting.
95 121
    If you created the `./config/autoload/database.config.php` file in the
96 122
    previous step, the alias you'll specify is 'masterdb'.
97 123
 

0 notes on commit 53738a2

Please sign in to comment.
Something went wrong with that request. Please try again.