Tag Archives: php

Quality-Assurance with PHP – Unit-Testing

Unit-Testing

There has been much said about the advantages or disadvantages of unit-testing. So I will not recap on that.
But where to go after you have choosen to use unit-testing?

The following short tutorial will give you an ovberview of how to install the necessary software, how to come to unit-tests from your requirements and how to write your tests and your code simultaneously.
Continue reading Quality-Assurance with PHP – Unit-Testing

fileinfo for PHP on Leopard

Currently I had to use the fileinfo-Package on my development-system which is a MacBook Pro running MacOS 10.5 with Marc Lianages PHP-Package.

But sadly that does not contain the fileinfo-extension.

No Problem I thought: Installing a PECL-Extension isn’t hard work.

At least if it works….

Of course I ran into the problem that I couldn’t compile the fileinfo extension due to the following error-message

configure: error: Please reinstall the libmagic distribution
ERROR: `/private/tmp/pear/download/Fileinfo-1.0.4/configure' failed

I can’t be the only one that ran into the problem, I thought. And so it was.

While searching the internet, I generally found two ways to solve the problem.

  1. Use PHP 5.3, that already contains the package
  2. Install a complete second OperatingSystem beneath a perfectly working MacOS. Here for instance I found a way to get the installation working by installing the complete fink-package.

Using PHP 5.3 was no option for me, as we are developing for PHP5.2 and installing a second Operating System seemed somewhat oversized for the simple task of installing a small PHP-extension.

Back to the roots

So what was the original problem again? A missing installation of the libmagic-library. Event though the info-binary is installed on the MacOS I’m running, a shared libmagic-Library is missing.

So what the hell, why not compile one?

Continue reading fileinfo for PHP on Leopard

Hyphenate texts with PHP

Hyphenation is something not widely used on the internet.

But sometimes it is something you need to do in Browser-based applications.

Just think of a PDF-File created on the fly by an application and the text is hyphenated in very strange ways or not at all. All just because of an algorithm that might hyphenate english texts in one way or an other but certainly not german, french or other texts.

But it is possible with a bit of LaTeX (don’t worry, you need no kowledge of that whatsoever)
Continue reading Hyphenate texts with PHP

TV-Browser and Growl

Ever wanted to find an electronic TV-Guide?

Some time ago I found TV-Browser. Very nice Tool.

One fancy feature was the Growl-Integration on MacOS-X.  Well at least until TV-Browser 2.7. Somehow the integration of Growl was broken under MacOS X 10.4. 

The complete information about this can be found in the TV-Browser-Forum

Well at least until yesterday.

I implemented this Patch and – voila – Growl notification works as expected.

For those who do not want to go through the hassle of compiling the plugin themselves:

Here you can download the compiled plugin that works for me under MacOS-X 10.4.11