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

Zend Developer Zone:
ZendCon Sessions Episode 38: Reusable Bootstrap Resources with Zend_Application
Feb 21, 2011 @ 16:40:35

New on the Zend Developer Zone today is the latest podcast in their "ZendCon Sessions" series (as recorded at the Zend/PHP Conference 2010 in Santa Clara, CA). In this episode Hector Virgen talks about creating reusable bootstrap resources with the Zend_Application component of the Zend Framework.

His talk introduces you to bootstrapping, shows how to get started with Zend_Tool and shares code and configuration details for using resources in your controllers.

You can listen to this latest episode either through the in-page player, by downloading the mp3 or by subscribing to one of their feeds. The slides are also on Slideshare if you'd like to follow along.

tagged: zendcon10 podcast session zendframework resource bootstrap resource zendapplication

Link:

Rob Allen's Blog:
Local config files and Zend_Application
Nov 29, 2010 @ 16:50:14

Rob Allen has a new post today showing you how to load in your own local configuration files into a Zend_Application Zend Framework app.

A friend of mine recently had a requirement where she wanted to have two config files loaded into Zend_Application, so that the specific settings for the server were not stored in the version control system. Hence she has two config files: application.ini and local.ini where local.ini is different on each server. The easiest way to approach this problem is to load the two files within index.php, merge them and then pass the merged config file to Zend_Application.

He includes the code to handle the import - pulling in both configuration files with Zend_Config and merging them with a "merge" call and setting their access back with a "setReadOnly".

tagged: zendframework zendapplication configuration file zendconfig

Link:

DZone.com:
Zend Application demystified
Nov 16, 2010 @ 14:39:37

Giorgio Sironi has a new post to DZone.com today looking at the Zend_Application component of the Zend Framework, hoping to shed some light on how you can use it for your applications.

While using single components of Zend Framework is as simple as including the source files, the MVC machine is quite more difficult to set up and the approach of organizing the boostrap via reusable, segregated application resources lets you manage the process without screaming for its complexity. However, it's not so simple to get Zend_Application to work the first time, and here's a primer on how it can help you.

He talks about how Zend_Application supports different environments (like testing or production) and what a resource is and how it works with the component. He shows a few examples with application.ini files that define the settings the Zend_Application should generate with and some sample code showing how to create a custom resource.

tagged: zendapplication zendframework component tutorial

Link:

Chris Hartjes' Blog:
Zend_Application and Zend_Acl
Aug 17, 2010 @ 17:08:49

In a new post to his blog today Chris Hartjes looks at some of his thought process when implementing authentication and access control in his Zend Framework applications.

One of the more frustrating things about using Zend Framework is that for pretty much any topic, there is always at least 2 ways to accomplish a particular task. For a beginner with the framework, this is a humungous barrier to overcome. When I try to implement something, my first question is no longer "how will I do this" but "where the hell should I put this code?". In my case, the problem I was attempting to solve was "how do I implement ACL for one module in my application?"

He found examples using plugins, pieces in the front controller, putting code in preDispatch but they didn't fit his situation. Instead he used these examples to create his solution. The code for this is included in the post along with a unit test (PHPUnit) to help ensure everything's working.

tagged: zendapplication zendacl example unittest

Link:

Matthew Weier O'Phinney's Blog:
Module Bootstraps in Zend Framework: Do's and Don'ts
Mar 12, 2010 @ 20:48:22

Matthew Weier O'Phinney as a new post to his blog today looking at a few "do's" and "dont's" when it comes to working with module boostraps in your Zend Framework applications - an apparently somewhat confusing topic for several developers out there.

In Zend Framework 1.8.0, we added Zend_Application, which is intended to (a) formalize the bootstrapping process, and (b) make it re-usable. One aspect of it was to allow bootstrapping of individual application modules -- which are discrete collections of controllers, views, and models.

He talks briefly about why module boostraps are run on every request (getting into some detail on Zend_Application), how you can properly set up your boostrapping process and how you can use plugins to initialize only the things you might need and, as he openly admits, that there's just not a really good way to handle this sort of module funcionality.

tagged: zendframework module bootstrap zendapplication

Link:

Matthew Weier O'Phinney's Blog:
Creating Re-Usable Zend_Application Resource Plugins
Feb 05, 2010 @ 15:42:12

In a new post to his blog Matthew Weier O'Phinney looks at creating reusable plugins for the Zend_Application component of the Zend Framework. This is a follow-up from his previous article introducing Zend_Application.

What happens when you need a re-usable resource for which there is no existing plugin shipped? Why, write your own, of course! All plugins in Zend Framework follow a common pattern. Basically, you group plugins under a common directory, with a common class prefix, and then notify the pluggable class of their location.

His example shows a plugin that can set the doctype of the view you're using and set the default page title and the separator. He mentions things like the framework's coding/naming standards, dependency tracking, setting up the configuration and, finally, doing the two actions laid out at the start. A few simple lines added to the application.ini file and you're all set to start using the new plugin.

tagged: zendframework tutorial zendapplication resource plugin

Link:

Matthew Weier O'Phinney's Blog:
Quick Start to Zend_Application_Bootstrap
Jan 12, 2010 @ 15:20:59

Matthew Weier O'Phinney has a recent post to his blog giving a quick introduction to the Zend_Application component of the Zend Framework and how it can be used to create custom resources.

Zend_Application works in conjunction with Zend_Application_Bootstrap, which, as you might guess from its name, is what really does the bulk of the work for bootstrapping your application. It allows you to utilize plugin bootstrap resources, or define local bootstrap resources as class methods. [...] Additionally, Zend_Application_Bootstrap provides for dependency tracking (i.e., if one resource depends on another, you can ensure that that other resource will be executed first), and acts as a repository for initialized resources.

Matthew gets right into the code, looking at how to create a simple bootstrap (for the "zf" command line tool to make the project) and the contents of the application.ini file. From there he looks at creating resources - bits of code that can be executed as a part of your bootstrapping process. His example shows the implementation of "_initCurrency" and "_initRegistry" methods.

tagged: zendapplication bootstrap quickstart resource

Link:

Pablo Viquez's Blog:
Zend_Log, FirePHP and Zend_Application. How to
Nov 30, 2009 @ 16:33:25

Pablo Viquez has written up a mini-tutorial on getting your Zend Framework application's errors to log out to the Firebug panel (from the extension) with the help of FirePHP and Zend_Log.

I wanted to enable logging of exceptions to my PHP log file and also display them using FireBug. On a standard setup of Zend Framework, the Zend error handler plugin (Zend_Controller_Plugin_ErrorHandler) enable by default [...] I wanted to keep using the error handler plugin and didn’t want to log the exceptions by using: Zend_Controller_Front::throwExceptions() or Zend_Controller_Response_Abstract::renderExceptions() or any other way since eventually might get complicated, besides, I think that the error handler plugin works fine and if it gets updated in the future, I won’t have to do a major refactor.

He shows how to create the Zend_Log object to write out on the development system (based on the ini setting for the Zend Framework application), how to use it to send the log message out to the waiting client. Examples of the output - a screenshot of the Firebug panel and the error log output.

tagged: firephp zendapplication zendlog tutorial

Link:

Zend Developer Zone:
Zend Framework 1.8.0 Released
May 01, 2009 @ 13:43:54

The latest version of the Zend Framework has officially been released - version 1.8, the first in the 1.8.x series with lots of new features including components encouraging the rapid application development functionality the framework already has and additional features to make it easier to use ZF in "the cloud".

I'm pleased to announce the Zend Framework 1.8.0 release, the first in our 1.8 series of releases. This release marks the culmination of several long-standing projects, as well as a formalization of many of our recommended practices.

The new rapid application development features include something that's been a long time coming, Zend_Tool. It gives you a command-line interface to build out ZF project parts and configure/display settings for them. Zend_Application was also released in relation to provide a standardized way for boostraping applications with either default configurations or custom settings.

Since cloud computing use has been on the rise, the ZF development team has added in two new components - interfaces for Amazon's Simple Storage Service and the Elastic Compute Cloud.

You can read more in the official press release from Zend.

tagged: zendframework release zendtool zendapplication amazon cloud s3 ec2

Link:

Rob Allen's Blog:
Initial notes on Zend_Application
Mar 26, 2009 @ 14:35:02

Rob Allen has a new post with a few introductory notes about the upcoming Zend_Application component of the Zend Framework that's coming and (if all goes well) will be deployed with the 1.8 version of the framework.

Zend_Application is now in the incubator and being actively developed for version 1.8 of Zend Framework. I've had a little play using it with a standard ZF application with no modules and this is what I've worked out so far. [...] Zend_Application is intended to make bootstrapping your application easier, presumably with less code.

He looks specifically at the bootstraping aspect of the component and comes up with an example Bootstrap.php file that sets up a configuration, a database resource, a view object and the location and information for the front controller. Another boostrap example shows how you can use a configuration file to do it similarly but more flexibly.

tagged: introduction look zendapplication boostrap example configuration file

Link:


Trending Topics: