Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Raphael Stolt's Blog:
Testing Phing buildfiles with PHPUnit
May 11, 2009 @ 14:33:20

Raphael Stolt has a new post looking at a technique to ensure that your Phing buildfile is how it should be via unit testing it.

While transforming some of the Ant buildfile refactorings described in Julian Simpson's seminal essay into a Phing context, it felt plainly wrong that I didn't have any tests for the buildfile to back me up on obtaining the pristine behaviour throughout the process. While Ant users can rely on an Apache project called AntUnit there are currently no tailor-made tools available for testing or verifying Phing buildfiles.

He includes an sample build file that will be tested and some PHPUnit code to execute the build and run several tests on the results like githubCloneAdhocTaskShouldBeDefined, targetLogBuildShouldBeAPrivateOne, propertyGithubReposDirShouldBeSet and more.

tagged: test phing buildfile phpunit custom runner example

Link:

Zend Developer Zone:
Wrapping C++ Classes in a PHP Extension
Apr 23, 2009 @ 15:21:50

On the Zend Developer Zone a new tutorial has been posted looking at taking your pre-existing C++ functionality and wrapping it in a PHP extension to be used directly in your code.

In this tutorial I am going to walk you through creating a PHP extension called "vehicles" which will expose a single class called "Car" (obviously in the real-world, your extensions will expose many classes, but I’m trying to keep things simple). The extension will be built for PHP 5. I am only going to give instructions for building the extension in a UNIX-like environment, although most of what I cover should apply to Windows extension development as well.

The tutorial walks you through everything - how the file layout should look, making a build system, the contents of his files (the sample extension lets you do things to the Car like shift gears and brake) and how to combine the C++ code with the build process to create a shared module you can include right in your php.ini.

tagged: module shared phpize buildfile tutorial c extension cplusplus class

Link:

Raphael Stolt's Blog:
Getting a visualization of a Phing buildfile
Oct 28, 2008 @ 17:03:41

Raphael Stolt recently spent some time working up a tool to visualize Phing buildfiles and he's blogged about it in this new post.

Out of the box the Phing -l option can be used to get a first overview of all available targets in a given buildfile but it doesn't untangle the target dependencies and sometimes a picture is still worth a thousand words. Luckily the Ant community already provides several tools to accomplish the visualization of Ant buildfiles, reaching from solutions that apply a Xslt stylesheet upon a given buildfile.

Using the ant2dot tool along with the Graphiz graphic library, he transforms the XML from the build file into a simple graphic showing the flow of the build. An example image is included.

tagged: phing visualize buildfile ant2dot graphiz stylesheet tutorial xslt

Link:

Raphael Stolt's Blog:
Setting up Zend Framework applications with Phing
Aug 27, 2007 @ 13:03:00

In this new post to his blog today, Raphael Stolt shows how to combine the Zend Framework and Phing to create a simple, quick setup utility for future ZF projects.

After spending too much time on directory and view script shifting to align an 'older' Zend Framework application to the very useful ViewRenderer Action Helper of the follow-up releases I crafted a single Phing buildfile to stick to the recommended conventions and to have a nearly 'one-button' setup solution for any upcoming projects.

He'd found some other packages that did something similar, but wanted to do it with Phing. He includes the requirements (the software) features that the buildfile makes easy to include and some future improvements that could be made to the install to make things even easier. The buildfile is included and any path or configuration changes that might need to be made.

Phing is a "make" replacement that uses XML build files to define tasks in classes.

tagged: phing zendframework automate xml buildfile phing zendframework automate xml buildfile

Link:

Raphael Stolt's Blog:
Setting up Zend Framework applications with Phing
Aug 27, 2007 @ 13:03:00

In this new post to his blog today, Raphael Stolt shows how to combine the Zend Framework and Phing to create a simple, quick setup utility for future ZF projects.

After spending too much time on directory and view script shifting to align an 'older' Zend Framework application to the very useful ViewRenderer Action Helper of the follow-up releases I crafted a single Phing buildfile to stick to the recommended conventions and to have a nearly 'one-button' setup solution for any upcoming projects.

He'd found some other packages that did something similar, but wanted to do it with Phing. He includes the requirements (the software) features that the buildfile makes easy to include and some future improvements that could be made to the install to make things even easier. The buildfile is included and any path or configuration changes that might need to be made.

Phing is a "make" replacement that uses XML build files to define tasks in classes.

tagged: phing zendframework automate xml buildfile phing zendframework automate xml buildfile

Link:


Trending Topics: