php Archive

Worthy of distribution: PHPUnit’s dbunit testing rundown

This is by far the most complete and best example of a rundown of database testing using PHPUnit's "dbunit" extension. It seems it's difficult to track down a whole rundown on the more technical aspects of 'getting into it'.The Ultimate Guide to Database-Testing with PHPUnitAuthor: Benjamin Eberlei (kontakt@beberlei.de)http://www.beberlei.de/dbunit.html Subscribe in a...
Read More

Interfaces in PHP are worthless. Blasphemy? yes.

What is the purpose of an interface? One would simply say "they're a contract, etc.", and you'd be right.Long story short, all PHP interfaces do - is enforce:- What methods are implemented- What their signatures look likeHowever there's one HUGE (in my book) fundamental lack: RETURN TYPES.Thus, I will call...
Read More

PHPUnit and apache ant junitreport task

There's not a whole lot of 'purdy' interfaces for parsing junit results. For what little that's out there - it's even a bit more difficult when you consider the PHP camp looking for a parser for the output from the likes of PHPUnit. If you're looking for an easy way out...
Read More

Add “th” (“nd”, “st”) to a number … painlessly – Part 2

So in the previous post I posted my recipe for adding rank suffixes to numbers.Sometimes - a simple problem can be frustratingly goofy to solve. I took a lazy shortcut by passing the number through mktime - then to date to do it for me.After analyzing what I came up...
Read More

Add “th” (“nd”, “st”) to a number … painlessly.

There's not enough out there about this trick - but you don't need a convoluted solution to add rank indicators to a number, so to add more noise to google search, here my variant is:[crayon-5c100bf92d7c9450055267/]Make sure you visit part 2!Logical breakdown:First we get mod of $n against 10 - essentially...
Read More

JQuery UI tip: floated divs inside JQueryUI tabs

There's a somewhat confusing problem that can happen if you want to use a multi column (floated div) chunk of content for a tab in JQuery UI tabs. Basically, the floats inside the tab container cause the tab container to lose it's height, making your content appear outside of the tab...
Read More

PHPCodesniffer and Zend Studio/Eclipse – Part 3

( Double-click the video to view more clearly )  Subscribe in a reader...
Read More

PHPCodesniffer and Zend Studio/Eclipse – Part 2

( Double-click the video to view more clearly )  Subscribe in a reader...
Read More

Take it to the next step

Very cool (albeit somehow hectic page) on pythian on a recent Rasmus session.There's a HUGE amount of information in this for people wanting to 'step to the next level' with web application development. You'll have to turn over some stones of your own and reapply some of this to you...
Read More

Configuring Aptana/Eclipse with PHPUnit – Part 4 of 4

 Subscribe in a reader...
Read More

Configuring Aptana/Eclipse with PHPUnit – Part 2 of 4

 Subscribe in a reader...
Read More

Configuring Aptana/Eclipse with PHPUnit – Part 3 of 4

 Subscribe in a reader...
Read More

Configuring Aptana/Eclipse with PHPUnit – Part 1 of 4

As mentioned in the video, you can obtain the phpunit file for extraction here: http://pear.phpunit.de/get/...
Read More

Running parallel versions of PHP – Part 2

The hard part is over, now for the easier stuff - for this part you'll need:CoffeePatienceNow we compile and install:[crayon-5c100bf92df53040617224/]Now if all goes well - the prefix you used in your configure (--prefix=/whatever)will have the following directories in it:[crayon-5c100bf92df5a336305494/]The file we care about the most is located in the bin/...
Read More

Running parallel versions of PHP – Part 1

With RC2 of the php5.3 release coming out, I wanted to run the new version alongside the stable version on our development server at M State. I wanted to be able to control this behavior via .htaccess files to control particular projects.What you'll need:Reasonable compiling experienceAbility to satisfy dependenciesUnderstanding and...
Read More

Tapping flickr, Part 1

This first quickie will be on iterating through the photos in a photoset (essentially, an album) and pitting them out in a thumbnail format with links to the larger versions.References:http://www.flickr.com/services/api/misc.urls.htmlhttp://www.flickr.com/services/api/http://us2.php.net/manual/en/ref.simplexml.phpRequirements:PHP with SimpleXMLFlickr Account, and a developer API key.[crayon-5c100bf92e19f477070811/]This will spit out a nice dump of what you have to work...
Read More