News Feed
Sections




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

VG Tech:
Inheriting Configuration in Zend Framework 2 Applications
August 30, 2013 @ 12:46:47

On the VG Tech blog they show how, instead of copy and pasting configuration settings all across their Zend Framework v2 application, they used inheritance to specify just the differences.

When working on Zend Framework 2 applications you might come across situations where you need to differentiate the application configuration for the different application environments, be it development, staging, testing and/or production. This can be cache TTL's, Memcached hosts, Redis hosts, debugging levels and more. Instead of copy/pasting the complete configuration across multiple "environment"-configuration files or having switches in the code. [...] We wanted to use inheritance so that for instance the staging environment would inherit the complete production environment, with the exception of some caching configuration which we want to override in the staging configuration.

They show how to set up the default configuration files for the application and models as well as how to pull in the environment-specific values and overwrite them in the "$config" set. He also links to another post showing how to cache all of this configuration (involving a lot of files) to help with performance.

0 comments voice your opinion now!
zendframework2 application inherit configuration

Link: http://tech.vg.no/2013/08/29/inheriting-configuration-in-zend-framework-2-applications/

blog comments powered by Disqus

Similar Posts

Matthew Turland's Blog: Gotcha on Scraping .NET Applications with PHP and cURL

Adam Culp: Zend Framework 2 XML Sitemap

Matthew Weier O'Phinney: RESTful APIs with ZF2, Part 1

LoLoCoJr BLog: Rewriting a (large) PHP application to Rails, part 1

IBM developerWorks: Use PHP to build a search engine optimization app


Community Events





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


release testing symfony2 install laravel series community api interview threedevsandamaybe developer list framework podcast language refactor opinion unittest code introduction

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