News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Evan Coury:
Environment-specific configuration in Zend Framework 2
July 19, 2012 @ 11:36:06

Evan Coury has a new post looking at setting up environment specific configurations in a Zend Framework 2 application letting you switch between configs based on an environment variable.

So you're all excited to try out ZF2. You clone the skeleton, install some modules, maybe even follow Rob Allen's excellent ZF2 tutorial, and finally, start building your application. Now, if you're a former ZF1 user or refugee from another framework, you might be troubled at this point by the fact that, at first glance, ZF2 doesn't appear to take into consideration environment-specific configuration values (e.g., development, testing, staging, production). Luckily, this is not the case!

He includes a bit of sample code showing how you can use a simple getenv call to pull in the value from an "APPLICATION_ENV" environment variable and put it into an autoload path.

0 comments voice your opinion now!
zendframework2 environment config variable getenv


blog comments powered by Disqus

Similar Posts

Nefarious Designs Blog: Vagrant Virtualised Dev Environments

Rob Allen's Blog: Returning JSON using the Accept header in ZF2

Derick Rethans' Blog: Variable tracing with Xdebug

EngineYard.com: Cloud Out Loud - Future of PHP (ZF2 & CakePHP)

Zend.com: Zend Framework 2.0 Beta 3 Release Gives Developers an Early Start


Community Events





Don't see your event here?
Let us know!


laravel interview unittest library configure podcast code threedevsandamaybe bugfix list series api release wordpress language community application introduction install developer

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework