Elizabeth Smith has a new blog post today showing the steps you'll need to get code coverage testing up and running on your Windows extensions.
She spells out a seven step process that involves Microsoft Visual Studio (with Code Coverage support), a properly compiled PHP instance and a little familiarity with the Windows command line to get things working.
As you can see, this could be a nice automated task. Figuring out this path to madness took a lot of googling to find some information about running code coverage from the command line.
She also includes a tip on getting the .NET parts to play nice with Visual Studio.
Keith Casey has written up somewhat of a preview of things to come at this year's PHP Appalachia:
PHP Appalachia originally came about a few years back because... well, I'm not sure, but I've heard (I wasn't there) that it resulted in a bunch of PHP geeks sitting around a camp fire, a bit hacking away a bit during the day, and generally building the community that PHP is known for.
He mentions other community members that'll be attending including Elizabeth Naramore, Ben Ramsey and Cal Evans for the four day long event.
On the PHPClasses.org blog today Manuel Lemos has posted a look at ORM - what it is and how you can use it to improve your applications.
Object-Relational Mapping, usually referred as ORM, is a software development approach to treat data stored in relational (SQL) database table records as if they were objects. Basically we can create classes with variables that represent fields of a database table. To insert a table record you need to create an object of the class, assign the variable values, and call a function of the class that takes care of inserting the table record
He illustrates what it is (brief code samples) and some of the approaches that developers have taken to implementing it. He suggests, however, that they should truely be called ROM (Relational Object Mapping) libraries rather than ORM due to the fact that they map an object (the database tables) back in to PHP objects. He finishes with a list of a few ORM resources and libraries including the one that helps power the PHPClasses website, Metastorage.
InfoWorld recently posted a review from their "Test Center" that looks at the latest version of Acquia's Drupal (v1.0).
As we've seen time and again, in an increasing number of enterprise software categories, open source has become a promising alternative to commercial software. But there's no free ride. Support from developers is often problematic, and you need to find products with a large enough following so that programmers have an incentive to build add-on modules. [...] Yet if you take support out of the equation, Drupal emerges as the better solution for many enterprise Web projects.
They point out some of the good (the power and flexibility of the CMS) versus some of the bad (the need for developers/admins with specific knowledge of the system) with a heavier lean towards the good. Other "goodies" they include are the robust installer, pre-integrated modules, like the Content Construction Kit and Mollom, and the ticket system built into the application for help with CMS-related issues (from Acquia).
Following up on their introduction to design patterns, the PHP Freaks have posted tutorials covering three of the more popular patterns - strategy/bridge, value object and singleton.
Keep checking back to their tutorials section for more design pattern tutorials.
In this new post to his blog Chris Hartjes suggests a new way to judge frameworks - how easy they make it to write unit tests against them and their resulting applications.
As a project for work gets ready for an alpha release, I've managed to eliminate all the serious bugs and now have some time for what should've been part of the project from the beginning: writing tests. [...] Since I'm using Code Igniter instead of CakePHP for this project (did I mention that I inherited the project and couldn't switch?) I started looking into the culture of testing surrounding Code Igniter. It's weaker than a newborn baby.
He tried to find anything he could use to write tests against the CodeIgniter application and finding fooStack as an easy to use tool for the job. This was what made him wonder how other frameworks stack up in the "has good unit testing functionality" category. He briefly covers four of them - CodeIgniter, Zend Framework, CakePHP and Symfony.
So now when you start comparing frameworks to each other, I think it's important you also consider how much effort has gone into creating tests for the core functionality of that framework. A well tested framework should mean far less surprises when using it.
Jani Hartikainen has posted a quick tip for Zend Framework users out there looking to force a download from their script.
"How do I make a file downloadable through my script?" This seems to be a relatively common question on #zftalk nowadays, so here's a quick wrapup!
He compares the two ways - the usual PHP-only way of using header() calls and echoing out the file versus the more Zend Framework way - using a Response object to pull in the content, set the headers and a helper to display/render the data output.
Asvin Balloo has posted a tutorial that shows how to combine the YUI libraries with PHP to create a simple image cropper.
This post will show you how to build an AJAX crop image tool using the image cropper control from YUI library and PHP. The ImageCropper Control from the YUI library gives you an interactive interface for getting the dimensions to crop an image and using these dimensions in PHP, we can do some cropping.
The script takes in an upload, shows it in the browser for cropping and once altered, pushes the altered image back out as a download. Full code is included as well as a demo of the final result and a sample file to get you started.
In a new blog post Cal Evans shares a solution he's come up with to help simplify his PHP development - using the Sun VirtualBox software to create a self-contained, controlled environment to run his scripts.
The more I thought about it though, the more I realized there had to be a better way. My current setup doesn't allow me to do things like test PHP 5.3 without setting up a whole new server just for that purpose, or maintain an environment like my production server.
He was looking for something that would work on a laptop, allow for easy environment switching and let him work on multiple projects at once. He came across the VirtualBox software and adapted it to his own needs (including shares folders between instances and multiple instances running Ubuntu) on his local machine.
The PHP Freaks website has a new tutorial posted today thats an introduction to design patterns - what they are and which were the ideas of the "Gang of Four".
Implementing Design Patterns is gradually getting more common in the PHP world. The hype around Ruby on Rails, which is based on the Model-View-Controller architectural pattern, has spawned a generation of PHP based frameworks which embrace this pattern also, paving the way for others to embrace design patterns in general in their PHP applications.
Design patterns are just a standardized way of doing something (like a Factory where, when you request an object, if one already exists you get that one instead of a new one). They illustrate the design pattern concept with a database abstraction system (UML) and a configuration setup where the main class inherits from the child type-specific ones.
Eli White has written up a new post about his opinions on certifications (and his habits relating them when it comes to resume reviews).
As it stands, I've shocked more than my share of people in the past when I've mentioned my stance on certifications for programmers. Specifically, when I have a pile of resumes in front of me, and I'm giving them an initial pass to sort them apart, I take any that mention their programming certifications, and sort them to the bottom.
He justification is that most of the certifications out there are pretty much useless and that, from his experience, those that list them on their resume are using it to appear more qualified.
So what is it that's so wrong with the certifications in the first place? Simply put, they prove nothing to me. They only prove that you could cram and pass a multiple choice test.
But, as he notes, programming is more about art than knowing the order of the arguments in str_replace. He illustrates his other point, "passing - yes but by how much?" with how the Zend Certified Engineer exam is handled. You get a pass or fail and you only know what you didn't do so well on if you fail.
The NETTUTS site has a tutorial posted today that's part one of a series looking at the Gamepress theme for WordPress and how to customize it to your needs.
GamePress is a "Gaming News & Reviews" theme for WordPress and currently one of the most popular themes at ThemeForest. It is the most advanced theme I've created so far, and really pushes what the WordPress engine can do!
This first of two parts introduces you to the template and the various components/content blocks it contains like the Features Slider, Latest Headlines, Older News and the Reviews page. You can check out a live demo of it in action to see what you think.
Symfony developers out there will be happy to know that, since the release of symfony 1.1, writing unit tests for your models has been made even easier.
Writing unit tests for your Propel or Doctrine model is much more easier as of symfony 1.1. In this tutorial, you will learn some great tips and best practices to write better tests for your models.
The tutorial walks you through the creating of a simple test - evaluating a few criteria for the database contents. The entire thing is contained inside of YML files and is easily run via the sfConfig and integrated Propel functionality.
As has been noted by Hyder Alamgir, there's been a recent big update to the Flex/Flash and PHP cookbook from Jonnie Spratley.
Here is a little thing that I made up for people using Flex/Flash and amfphp a little cheat sheet to use as a reference. This has been completely re-done since it has been so popular. I have commented all of the code very well so that does most of the explaining of what code does what. I also added a few more calls such as sending email, sending images, sending files, searching and pagination.
"Recipes" include everything you'd need to get all set up - installing AMFPHP, connecting to MySQL, creating a CRUD interface and making calls back and forth. Other examples include sending emails and a comparison of the data types between PHP and ActionScript.
Andrew Wulf passed along a note about an ajax-based PHP documentation site aimed at making it simple to get at the PHP manual from a single page interface.
I wrote this little app for my own needs initially, as PHP is such a big monster that it was hard to find the right documentation, or discover which of the N similar packages I should use. When I moved servers I fixed up the app enough and decided to release it to the world. It's pretty handy as is, but there are still several things I need to add, particularly paging through the documentation, and supporting bookmarks.
The site, phpdox.net, supports two kinds of searches - one through an index of page titles and another through the hierarchical names of the documentation's filenames.
DevShed has finished off its CodeIgniter series today with this ninth part focusing on making a simple content management system with the framework.
Designed to allow programmers to create applications rapidly by utilizing the Model-View-Controller pattern, the Code Igniter framework lets you add many capabilities quickly and easily. This article will bring everything we've learned together for the creation of a content management system.
Their system combines the bits of knowledge from the previous parts (segments of specific functionality) and combining them into a MySQL-driven system to store some information about the user's favorite movies.
Mike Bernat has come up with a list of (eight things) his best practices when it comes to PHP development:
I suggest a more retro-active approach [than trial and error]. Studying, surrounding, and forcing yourself to abide by best-practice coding standards will yield surprising results in your applications despite the fact that it may seem like more work than it's worth.
Topics included in his list are things like:
Check out the rest of the post for more suggestions and explainations.