On NETTUTS.com today there's a new tutorial to help you get started with effective test-driven development in your PHP applications with SimpleTest.Testing your code is annoying, but the impact of not doing so can be orders of magnitude more annoying! In this article, we'll use test-driven development to write and test our code more effectively.They start with the basics - what test-driven development is, why it's a good idea and how the whole process works to improve your code. They opt for a bit...
New on his blog Matthew Weier O'Phinney has this post looking about using the FilterIterator (from PHP's SPL libraries) to work with (recursive) directory iteration.I'm currently doing research and prototyping for autoloading alternatives in Zend Framework 2.0. One approach I'm looking at involves creating explicit class/file maps; these tend to be much faster than using the include_path, but do require some additional setup. [...] I'm well aware of RecursiveDirectoryIterator, and planned to use that....
Yep, it's the third week of the month again- and you know what that means: Zend Framework Monthly Bughunt! This Thursday, Friday and Saturday of August (the 19th, 20th and 21st 2010), we'll be hosting our monthly bug hunt. For those of you unfamiliar with the event, each month, we organize the community to help reduce the number of open issues reported against the framework.
On the Ibuildings techPortal today they've posted the latest podcast in their DPCRadio series - Elizabeth Naramore's presentation on technical debt.Technical debt is something that most project teams or independent developers have to deal with '" we take shortcuts to push out releases, we don't focus on quality, deadlines need to be met, quick fixes slowly become the standard. Whatever the reason, if we don't manage our technical debt (not unlike financial debt), before too long our applications are...
During the past week, I've been looking at different strategies for autoloading in Zend Framework. I've suspected for some time that our class loading strategy might be one source of performance degradation, and wanted to research some different approaches, and compare performance.
In this post, I'll outline the approaches I've tried, the benchmarking stategy I applied, and the results of benchmarking each approach.
Continue reading "Autoloading Benchmarks"
If you know Matthew Weier O'Phinney (MWOP) then you have probably already read this post. If you don't know him, click on in and I'll give you the low-down.
On the SitePoint PHP blog today Craig Buckler talks about uploading large files in your PHP application. He points to two other resources - this manual page and this introductory tutorial about handling file uploads to get the ball rolling.One of the most popular uses is image uploads. Your users can submit photographs from a form without resorting to FTP or other convoluted methods. HTML5 and Flash also permit drag and drop, so the operation is likely to become easier as browsers evolve. This is where...
Latest PECL Releases:
Uploading a file from a web form in PHP is easy. The online manual provides a Handling File Uploads section, and there are several articles on sitepoint.com, including How To Handle File Uploads With PHP by Kevin Yank.
One of the most popular uses is image uploads. Your users can submit photographs from a form without resorting to FTP or other convoluted methods. html5 and Flash also permit drag and drop, so the operation is likely to become easier as browsers evolve.
This is where the problems can...
On the Facebook Engineering blog there's a new post summarizing the last six months since they released the HipHop tool for PHP along with some of the stats from the time.Since February, the team has made HipHop another 1.8 times faster and all of that code is open source. We've also seen improvements to PHP itself with the additions to PHP's trunk in April being about 10% faster than 5.3.They talk about projects they've worked with (including Drupal and WordPress), community contributions, a first use...
Daniel Jensen has a new post about using Gearman to do some simple database inserts asynchronously.If you need to do a lot of inserts in your DB with a certain line of order they should be carried out in or with a clean-up script following after the inserts and you don't have to wait for a reply from MySQL, the answer to that problem might be this worker written in PHP for Gearman as an interface for your DB. A MySQL crash or a worker crash will have no impact on your inserts because they will just stay...
In this new post Bradley Holt shares some of the results he found in questioning his local user group about why they would get involved with the user group.This was certainly not a scientific survey and there were only 16 responses, but it still offers some insight that can be useful in planning user group activities. Here are the top reasons...The reasons included things like "learning from peers", "meet the experts" and "finding job opportunities". He graphed the results showing that learning from...
Lorna Mitchell recently attended the cicon2010 conference in Bristol (a CodeIgniter-centric event) and has written up a summary of her time there.I spent the weekend in Bristol so I could attend cicon2010 - a volunteer-organised first-edition conference around the CodeIgniter PHP Framework. [...] I saw two talks, both of which were actually really good, which is pretty impressive when you're going on stage to a rather fed up audience! Kudos to Kevin Prince and Joel Gascoigne for their talks.She also...
In this quick post to his blog Matthew Turland shares a "kink" he found in using the FilterIteractor SPL iterator when working with the Phergie project's code.Once I discovered the segfault [from the FilterIterator code], I had to come up with a short code sample exposing the bug in order to report it.He talks about the bug that led him to the segfault and a second bug that was a side effect of the first causing the first element to be skipped during iteration.
Jani Hartikainen has a few suggestions on how to handle exceptions in your application - more specifically how to handle them in your classes and still keep proper abstraction.So you already know how to handle your errors properly. Even if you're already using exceptions, there are some nuances to the use of exceptions that are important to know and understand in order to write code that is easier to reuse and more decoupled. Let's talk about exceptions and how they relate to your classes and...
I'm currently doing research and prototyping for autoloading alternatives in
Zend Framework 2.0. One approach
I'm looking at involves creating explicit class/file maps; these tend to be
much faster than using the include_path, but do require some
My algorithm for generating the maps was absurdly simple:
Scan the filesystem for PHP files
If the file does not contain an interface, class, or abstract class,
If it does, get its declared namespace and classname...
Over the years, I have gotten quite a few "complaints" from PHPUnit users that they do not like typing $this- as often as they have...
On the PEAR blog there's a new post updating you on some of the happenings with the PHP packaging tool recently.We've been fairly quiet, launching pear2 and pyrus into the line up, welcoming new faces to the QA team, Jesus Espino, and getting ready to call an election for the new pear group.They also mention several package releases (including updates to Net_DNS and Services_Twitter) and a call for contributions from anyone out there by working on deprecated code, unit tests or even just bug reports.
During the development of an application, not all time is spent
on writing code. A lot of time is spent on reading debug output,
crawling through log files and firing up the debugger to figure
out what the application does. While the debugger helps us to
inspect details of a running application on a testing
environment, logfiles are often the only indication of the origin
of an error on a production system. In this blogpost I want to
describe how to log SQL statements on an existing application...