News Feed
Sections




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

Rob Allen's Blog:
Custom Zend_Application Resources
January 12, 2010 @ 13:49:18

Rob Allen has written up a post about creating custom resources for your Zend Framework bootstrap process (for more see Matthew Weier O'Phinney's post here). In Rob's case, he wants to create one for a CouchDb interface.

In my case, I wanted to create a resource for CouchDb that checked that the database was created and if not, create it. Creating your own plugin is easy enough. The obvious place is library/App/Application/Resource

The code is quick and easy - a class that extends the Zend_Application_Resource_ResourceAbstract component and defines a basic init() method that pulls in the settings from the application.ini file for the "resources.couchdb" section. These settings can be used to create the connection or whatever needs to be done to set up the object for future use. You'll also need to add a line in the application.ini to tell the application about the custom resources directory too.

0 comments voice your opinion now!
zendframework resource couchdb custom


blog comments powered by Disqus

Similar Posts

AjaxRay.com: Extending Zend Form Element to create customized Phone number field

Padraic Brady's Blog: Zend Framework: Surviving The Deep End Book - Chapters 8 and 9 Published

MaltBlue.com: Zend Form Mastery with Zend_Config - Part 2, Core Form Configuration

Mike Willbanks' Blog: RPM Packaging - Building and Deploying your own PHP

Alexander Netkachev's Blog: Automatic testing of MVC applications created with Zend Framework


Community Events





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


community framework package tips list install opinion podcast symfony language introduction api laravel voicesoftheelephpant series release deployment bugfix interview library

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