phpfunk.com


Archive for February, 2010

how to upgrade an old PEAR installation

Sunday, February 21st, 2010

I ran into some challenges when trying to install PHPUnit on a server that had PEAR installed a couple years ago. The install failed because the PEAR package itself was outdated. The installed PEAR version was 1.4.11 which came out in August 2006. So I did a little internet research and found this excellent post [...]

using phing as a build tool for php projects

Saturday, February 13th, 2010

You do not compile php so why would you consider using a build tool? There are several reasons, all of which have to do with automating common tasks. First you need to know conceptually how a build tool works. In this case I’m describing phing, which is specific to php and modeled after apache’s ant [...]

how to develop quality software

Thursday, February 11th, 2010

First create a prototype. This is for all you folks who like to dive in and start writing code right away ;^) This way you can try out your approach to solving the problem, or maybe it will help you dissect a large complicated project into smaller more units. Sometimes the prototype is just a [...]

site in transition

Tuesday, February 9th, 2010

Recently converted site to wordpress. Does about 90% of what is needed, but sometimes the layout isn’t compatible with the content (eg: text and images in the main column flow over into the right column). Really don’t have time to fix the layout at the moment, so it is what it is. And for what [...]

using this in javascript method bodies

Tuesday, February 9th, 2010

This is a clear reference on the subject.

traversing xml with javascript

Tuesday, February 9th, 2010

Here are some excellent references on walking thru a XML blob with javascript. I was a little rusty. The main issue was that every element has a child node that is a text node, even if that text is empty. I was laboring under the misconception that somehow the text portion of an element was [...]

example text area with javascript character counter

Saturday, February 6th, 2010

If you plan on only accepting a fixed number of characters from a textarea, its probably a good idea to tell the user how many they have left. This examples demostrates using javascript to count the number of characters entered in a textarea. Actually, you can use this to figure out how many characters where [...]

database abstraction for php 4

Saturday, February 6th, 2010

Still stuck in PHP 4 but need a DB abstraction layer like PDO but with only the basic functionality?

database abstraction layer

Saturday, February 6th, 2010

Way before PDO came out one of the first things I needed was a good database abstraction layer. In fact, php 5 wasn’t even available as a stable branch of php at the time. The resulting PHP class was to be modeled after the perl DBI package, except stripped down to minimum amount of features. [...]

prototype ajax examples

Saturday, February 6th, 2010

These examples use the prototype library. View the HTML source to see my javascript functions. Refer to the prototype API for examples and explanations of Ajax, etc. Example One Here we submit a form in an ajax way. The onsubmit is used to send the request and get the response and update the div. The [...]