Archive for June 14th, 2007

Zend Developer Zone: PHP Abstract Podcast Episode 4: Planning Programming

The Zend Developer Zone has posted their latest podcast in the PHP Abstract series. This time, it’s a focus on planning in your programming projects - how to get the most structure out of the simplest planning.

Davey [Shafik] is going to talk to us about one of the most neglected areas of software development, planning the project.

Grab the podcast directly here or subscribe to the feed to get this and other episodes of this quality podcast.

Continue Reading · Add comment

PHP-Coding-Practices.com: Composing Methods: Replace Temp With Query

In a new article from PHP-Coding-Practices.com today, Tim Koschuetzki offers a different sort of solution for working with those little temporary variables scattered throughout your code - replacing a temporary variable with a queryable structure.

When you are using a temporary variable to hold the result of an expression, extract the expression into a method. Then replace all references to the temp with the new method. The new method can then be used in other methods.

His suggestion basically replaces the quick temp variable with something slightly more complex but something that can be used anywhere in the class. He uses the example of multiplying an amount times the quantity - first just assigned to a temporary variable inside a method then refactored as the result of another method returning the same thing (but accessible from anywhere).

Continue Reading · Add comment

Community News: Welovelocal.com offers SOAP API (with PHP examples)

David Mytton submitted some information in an email to us today pointing out a new UK-based website, WeLoveLocal.com, and a SOAP API that they offer:

welovelocal.com is essentially the Yellow Pages written by your
friends. It provides a full directory of UK businesses (currently
London only but launching across the UK shortly) and contextualises
the reviews, and a network of friends around you.

The SOAP API allows you to query the sites data stores with different functions that let you get businesses by a search term, get their reviews and search the businesses based on a category and a search term. The reference page includes the input and output values of the API as well as some sample PHP code to show you how to make the request (using the SOAP functionality in PHP5).

Continue Reading · Add comment

DevShed: Databases and PHP

DevShed has started a new series looking at working with PHP and databases with this new tutorial posted today, an excerpt from the O’Reilly book “Programming PHP, Second Edition”.

We focus on the PEAR DB system, which lets you use the same functions to access any database, rather than on the myriad database-specific extensions. In this chapter, you’ll learn how to fetch data from the database, how to store data in the database, and how to handle errors. We finish with a sample application that shows how to put various database techniques into action.

In this first part of the series, they look at what kinds of things are possible with the database connection, some of the basics of using the PEAR DB class and working with data source names to help with the connection.

Continue Reading · Add comment

Paul Jones’ Blog: A Bit About Benchmarks

In response to a previous article from the Symfony blog, Paul Jones has pulled together some thoughts to some of the comments they made.

As the author of a relatively popular benchmarking article, I feel compelled to respond to this bit of misguided analysis from the Symfony camp about benchmarks.

Paul talks about the “straw-man arguments” presented in the Symfony article, including some references to Paul’s previous benchmarks. He’s even broken it down into a point-by-point response to make each point clear.

Continue Reading · Add comment