News Feed
Sections




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

Master Zend Framework:
Make Module Configs Cacheable with the ZF2 Factory Interface
March 07, 2014 @ 11:25:09

Matthew Setter has a new post today on the "Master Zend Framework" site looking at the use of caching for Zend Framework 2 module configurations.

For the longest time, I've been using closures in my Zend Framework 2 Modules Module class. I know they're not always the best approach, but they're not necessarily wrong either. But after reviewing Gary Hockin's recent talk at PHP Conference UK, I was reminded that outside of APC and OPCache, closures aren't cacheable. [...] So in today's tutorial, I'm going to show you a simple example of how to migrate from closures using [caching with Memcached, Redis and so on].

He starts with an example of the standard closure approach, returning an array from his "getServiceConfig" method with sub-array and object creation nested inside. He then refactors it to use the "FactoryInterface" to handle the configuration setup for the "delete form" handling.

0 comments voice your opinion now!
module configuration cache zendframework2

Link: http://www.masterzendframework.com/tutorial/zf2-factory-interface-closure-migration

blog comments powered by Disqus

Similar Posts

ThinkPHP Blog: Methods to Reduce the Load of Your Webserver by Caching Content

Zend Developer Zone: Synchronizing Drupal Modules with Adobe AIR

Richard Thomas' Blog: Performance of Zend_Loader

Jamroll.co.uk: Using Lighttpd to Dodge the Digg Effect

MaltBlue.com: Zend\Db\Sql\Select - The Basics (Columns, Limit & Order)


Community Events





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


series release introduction community zendserver development tips deployment podcast laravel threedevsandamaybe framework list conference interview bugfix language api symfony code

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