Looking for the 'nick-dev' section in our config file in listing 10.3 we can see
that it inherits from the 'general' settings as indicated by the [ child : parent ] syntax of the ini file and therefore
the database settings are being reset to those of a local development database.
Listing 10.3 The contents of our config.ini file
[general ] A
Licensed to Menshu You
Zend Framework in Action (Ch01) Manning Publications Co. 3
database.type = PDO_MYSQL
database.host = localhost
[production : general ] B
database.username = production
database.password = production123
database.dbname = production_main
[rob-dev : general ] C
database.username = rob
database.password = roballen123
database.dbname = robs_dev
[nick-dev : general] D
database.username = nick
database.password = nicklo123
database.dbname = nicks_dev
A The general ini section from which all other sections inherit
B Settings for the final production server
C Settings for Rob's development server
B The nick-dev section with database settings used in our example
What we have managed to do so far is to contain the implementation changes within the index.php file and
the configuration file. Even better, we've managed to do it in a way that allows us to move those files around
without having to change the files themselves.
Pages:
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280