A Lesson In Static Methods And Late Static Binding
Monday, April 12th, 2010Until last week, I had never experienced what must have been incredibly frustrating to most developers: the fact that the self keyword in PHP refers to the class it is located in, and not necessarily a class that extends it. I personally ran into this problem when trying to extend Zend_Auth. Being a singleton, the constructor in Zend_Auth is protected, and the static method Zend_Auth::getInstance() instantiates itself. The problem is, when extended, My_Auth::getInstance() still returns an instance of Zend_Auth. The solution was to duplicate the static method in my My_Auth class, which worked properly. For example:
7:00 am | Comment (4) | Print | Categories: Object-Oriented Development, PHP 5, Zend FrameworkGit Versus Subversion: A Reconsideration
Friday, April 9th, 2010Back in January, I wrote about my feelings that Subversion still beats Git when it comes to the corporate environment. I pointed out that Git has some great features, but that the corporate world was heavily invested in Subversion, and was likely to stay that way.
7:00 am | Comment (18) | Print | Categories: Version ControlEncouraging Open Source Contribution
Wednesday, April 7th, 2010Leaders of the open source community are always trying to encourage others to contribute. Volunteer contributors are always in short supply, and most open source projects are driven by volunteers, so recruitment is a big component of any open source project lead. Elizabeth Naramore put together a great list of reasons why people tend to shy away from contributing and did a great job highlighting some solutions. I want to add my own voice and experience about one of the truisms of open source development:
7:00 am | Comment (2) | Print | Categories: Community, Open SourceCaching For Efficiency With Zend Framework
Monday, April 5th, 2010One of the things I’m always looking for is ways to improve performance with the applications I write. While a few applications are write-heavy, most are read-heavy: that is, reading the database is the predominant behavior (for example, this WordPress blog reads the database far more often than it writes to the database). Additionally, Zend Framework is (comparatively) slow at handling requests, offering a throughput of about 67 requests per second on my machine, while loading static pages came in at a whopping 750 requests per second.*
7:00 am | Comment (15) | Print | Categories: Zend FrameworkControlling Access: Zend_Navigation and Zend_Acl
Friday, April 2nd, 2010In the last two entries, we examined creating a navigation structure with Zend_Navigation, and then we examined using that structure with the Zend Navigation View Helper. In both discussions, we focused on creating navigation items and menus, and inherently these items were available to all users regardless of access controls. But what happens when you have special areas of your site, say for subscribers or administrators? Controlling access is something that all web developers must do at some point. This is where integration between Zend_Navigation and Zend_Acl comes in.
7:00 am | Comment (5) | Print | Categories: Zend Framework
Web developer, amateur photographer, lover of the outdoors and travel. Expect to find me writing code, hiking or visiting new places. I own Blueprint DC and live in Washington, DC. Follow Me On Twitter!- July Slides
- Some Thoughts On Software Licensing
- Interfaces Make Testing Easier
- Revisiting: Why Every Developer Should Write Their Own Framework
- The Fallacy of Sunk Cost
- PHP: The Good Parts – Book Review
- 1st Amendment, Meet 4th Amendment: The Gizmodo Search Warrant
- A Closer Look At ArrayObject
- TEK Webcast Notes
- Caching For WordPress – A TEK-X Webinar
