Archive for February 4th, 2008

Lee Blue’s Blog: How To Implement A Ruby on Rails style before_filter With The PHP Zend Framework

Lee Blue has posted something looking to bridge yet another gap between Ruby on Rails and PHP - a method for adding before_filter functionality to PHP.

I often use this when implementing a simple login screen for a password protected section of my application. In a Zend Framework application you can implement a preDispatch() function in a Zend_Controller_Action which will run before an action is dispatched. This lets you setup your filter to check to see if the visitor is logged in or not. If the visitor is not logged in, you can redirect them to the login screen of your application.

He includes example code to show its usefulness - checking to see two things: is a user is logged in and to see if they’re allowed to use a certain resource.

Continue Reading · Add comment

Padraic Brady’s Blog: Zend_Yaml; Gone the way of the Dodo…

In filtering through the mass of projects that he’s collected around him, Padraic Brady has decided to cut one loose - the Zend Framework package he’d been developing to introduce YAML parsing and functionality to the framework.

I’ve been going through all those open source projects and cutting the dead weight. […] One of the victims of this review has been Zend_Yaml. Earlier this morning I found an odd comment on the Zend_Translate_Yaml proposal by Thomas Weidner that he was erasing his proposal on the basis that there had been no progress on Zend_Yaml.

He’s removed the proposal from the Zend Framework proposal pages after receiving an email noting that the package would not comply fully to the YAML 1.1 specification and couldn’t be included. With the introduction of the Syck extension into PECL, it could support it but Padraic opted to just tell the ZF group about this functionality rather than working on the build himself.

Continue Reading · Add comment

DeveloperTutorials.com: PHP Debugging with Zend Studio

Debugging can be one of the most important tools to a developer (web or otherwise) and one of the more popular PHP IDEs, Zend Studio, makes it relatively simple to do. The Developer Tutorials website has this new tutorial to help you get started on the path to being bug free.

For the majority of experienced PHP developers, Zend Studio is considered the top-of-the-line PHP IDE. […] In this tutorial, we will explore how to use the latest update of Zend Studio for debugging PHP scripts.

They walk through an overview of the IDE, some of the requirements and the install process and, finally, they finish it off with a few pages talking about how the get the debugging up and running.

Continue Reading · Add comment

SitePoint PHP Blog: Dealing with Dependencies

On the SitePoint PHP blog today, Troels Knak-Nielsen has written up an article that talks about dependencies in your applications - those little interconnections your code relies on to do more with less.

In lack of better words, I’ll call this compositional programming style. It’s a style which is usually more prevalent with experienced programmers. […] There is, however, a dark side to composition - dependencies.

He starts with a definition to bring everyone up to a level field then moves on to how their used (through a “global symbol” or directly passed in) and how they can “leak” if you’re not careful.

To help protect you and your code from any kind of damage down the line, Troels suggests making a container to keep objects where they need to be. He even includes an example with namespace support to make things even easier down the road.

Continue Reading · Add comment

Tony Bibbs’ Blog: Microsoft and PHP

Tony Bibbs, in the wake of last week’s surprise from Microsoft to Yahoo, has posted a few of his thoughts on the matter.

I woke up this morning to the news of a $44 billion buy-out offer from Microsoft for Yahoo!. This is being covered from all angles in various tech sites like Slashdot but I think the one angle I haven’t seen yet is what does this mean for PHP?

He mentions the work that Microsoft and Zend have done to push PHP support on the OS (check out this email too) and he wonders what the final impact of it all could mean for the language - will things change drastically if Microsoft becomes a major player in the PHP world or would they stay behind the scenes and give the community the support it might need.

Continue Reading · Add comment