O'Reilly logo

Zend Framework 1 to 2 Migration Guide by Bart McLeod

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Development Practices

Configuring Different Environments

In ZF1, we were used to have different sections in application.ini, like Production, Testing, and Development, and often a few personal developer sections, like 'dev_bart'. By setting an environment variable, you could easily distinguish between environments and, for example, load different database credentials. In ZF2, this is solved in a different manner.

Let’s take database configuration: Imagine you built a module that uses a MySQL database. You might have configured the database adapter with the key db_adapter_book inside your module configuration.

Note: If you want to make your module reusable, you should consider not configuring your database adapter within your module, but instead ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required