Archive for July 30th, 2007
PHP Developer - July 30th, 2007
The Internet Super Hero blog has posted some new tests using the mysqlnd driver for PHP and shows you how it’s all done for you to follow along at home.
PHP extensions can test their userland (PHP) functionality using so called “phpt Tests”. phpt Tests consist of several parts with their main part being regular PHP code to test PHP. On the website of the PHP Quality Assurance Team you can find a documentation of the phpt Tests syntax on the page Writing Tests, if your are interested in the details. Most extensions contain a tests/ subdirectory in the PHP source code to ship the tests together with C code of the extensions. So do ext/mysql and ext/mysqli.
They show the testing structure they used and some of the stats they found from their runs. The rest of the post is dedicated to how it was all set up:
- implemented as phpt Tests
- which need new settings
- Using run-tests.php to run the tests
- Failing tests
- Useful run-tests.php options and features
They also briefly mention what a typical set of test results are (for the time the post was made).
Continue Reading ·
PHP Developer - July 30th, 2007
Fernando Bassani has posted an alternative to using globals in your scripts - creating “global objects” with the help of the Registry design pattern.
For a long time, the “programming good practices” tell us to avoid globals. In fact, this is a point of a large criticism in languages such as PHP. A nice solution to our global’s “needs” is the Registry design pattern. With it, we can have a repository with the data that has to be accessible, removing them from the global scope.
Included in the post is all the code you’ll need to get it to work. It uses a Singleton to grab the latest object and allows you to store values and define namespaces to keep data separate.
Continue Reading ·
PHP Developer - July 30th, 2007
While frameworks seem to be popping out of the woodwork, Mike Willbanks has noticed something lacking - a good e-commerce framework that helps the developer do simple things like work with shopping carts or connect with payment APIs.
So here is my question, besides the really shitty shopping cart objects out there is there any true components for a framework that utilizes this functionality? I say shitty shopping cart objects because just about every single open source PHP shopping cart has some of the worst design aspects I have ever seen.
His complaint is that most of the shopping cart software out there is really just procedural (or bad) code shoved into classes and called good. He suggests a more patterned approach - maybe using a Factory on top of a base abstract model.
Continue Reading ·
PHP Developer - July 30th, 2007
From The Bakery today, there’s a new tutorial that steps you through the process of getting the Eclipse software set up and working happily with a CakePHP installation.
So you’re on a noob on the quest for painless PHP development? You’ve started using Cake and now you’re considering the Eclipse Integrated Development Environment. These are two great first steps. All you need now is a little help getting to know Eclipse and configuring it for maximum effect with CakePHP. This tutorial gathers lots of information already out there, adds a bit of my own, and puts in all in one place.
They work through the installation, how to define a workspace for your project and getting the “bake” command to work directly from the local software.
Continue Reading ·
PHP Developer - July 30th, 2007
In the wake of this year’s OSCON, Cal Evans has posted his PHP-centric wrapup over on the Zend Developer Zone:
The echoes from the last OSCON parties haven’t even stopped reverberating though the halls as the next convention moves in. The vendors are all long gone and the attendees are all shoved in tiny seats on their express flight back to the real world. Let’s take a quick look over our shoulder at the party that was OSCON ‘07 before answering the call of the road and heading off to the next event.
Some of his items of note included the PHP tutorials (specifically the “PHP and MySQL Best Practices” from Luke Welling and Laura Thomson) and the many talks including one given by Andi Gutmans covering the Zend Framework and its role in a mashup involving Yahoo’s Term Extractor and Flickr.
Continue Reading ·