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

Piotr Pasich:
Ant, composer and code quality tools
Mar 18, 2015 @ 16:33:47

In his latest post Piotr Pasich shares some handy tips (and tools) to help you use Composer to do some of the common tasks you might use Ant or Phing for.

I decided to start with something uncomplicated – a simple solution that could help me solve a prosaic, but annoying issue. For instance, XML format. No, I won’t fight with it. I see it as great and practical, however mostly I don’t need so sophisticated code to cover my needs – the yaml usually fits the purpose. [...] Yet, do I really need this flexibility [of XML configuration] when I use vagrant or docker to maintain the same environment as on the production? For 90% of PHP projects probably I won’t use all of the features of the virtualization tools. I only want to install necessary libraries, check the code quality before committing or introduce fixtures. Most of those points are easily feasible in composer.

He then shows how to execute these checks through the functionality included with Composer to run custom scripts. His example measures the quality of the code based on the results first from a single run of the PHP Mess Detector (phpmd) command. He then extends this with the open source contribution he mentions earlier with his CodeQualityThreshold library allowing not only for more checks (phpmd, phpcs, phpcpd, etc) but also allows you to configure the thresholds for each class if desired. He includes an example of it in action and screenshots of the results.

tagged: ant composer code quality phpmd commandline library codequalitythreshold threshold

Link: http://piotrpasich.com/ant-composer-and-code-quality-tools/

Wojciech Sznapka's Blog:
Deploying Symfony2 applications with Ant
Apr 23, 2012 @ 15:54:04

In this new post Wojciech Sznapka shows you how to can set up an Apache Ant deployment for a basic Symfony2 application - including installation of vendor packages and assets.

When you have plenty of Symfony2 applications and you need to deploy them from time to time, you are probably sick of thinking about every activity you need to do for every deploy. Often people use some build scripts, which are hard to maintain and tends to be unreadable. I wanted to automate it as much as it possible and I’ve choosen Ant, to help me out.

An example build.xml file is included in the post that shows how to:

  • Pull the current code from git
  • Install vendor packages
  • Fix permissions for the log and cache directories
  • Clean up the cache
  • Dump/install any additional assets
tagged: symfony2 application deployment apache ant

Link:

PHPMaster.com:
Continuous Integration (with Jenkins), Part 2
Apr 02, 2012 @ 13:18:49

Following up from his previous post about setting up PHP with Jenkins, J Armando Jeronymo is back with part two of the series - setting up an example project to show how the pieces fit together.

In the first part of this article I presented the case for Continuous Integration. Now we’ll install and set Jenkins up to monitor the automatic building of a simple demonstration PHP application. We’ll begin with the demo project, then address Jenkins’ installation, and finally set it up and watch it running.

He includes a sample project structure, complete with a PHP class and its tests. He shows how to manually run things first (so you'll know what the commands do), the contents of the class/tests and the example Ant configuration file. He's also included screenshots of the Jenkins interface, showing how to create a build, add a new step and let the build run to evaluate the results.

tagged: tutorial jenkins continuous integration phpunit unittest ant build

Link:

Sebastian Bergmann's Blog:
PHP Project Wizard
Feb 07, 2011 @ 16:35:06

In this new post to his blog Sebastian Bergmann mentions yet another new tool he's released - the PHP Project Wizard, a tool that helps with the creation of configuration files for setting up project build automation.

The PHP Project Wizard (PPW) is a commandline tool that can be used to generate the scripts and configuration files necessary for the build automation of a PHP project. Given the location of a project's directories with sourcecode and tests as well as the project's name, the PHP Project Wizard generates scripts and configuration files necessary for build automation using Apache Ant.

An example of its use is included - a simple call to the shell script with information about the source, tests and project directories. It then generates the XML files for Ant and PHPUunit to run. The result can then be used in the Jenkins jobs for PHP setup seamlessly.

tagged: project wizard jenkins apache ant automatic build

Link:

Pavel Shevaev's Blog:
taskman: yet another Ant alternative
Oct 14, 2010 @ 14:56:39

Pavel Shevaev has put together what he calls "yet another Ant alternative" - a tool written in PHP to create project related tasks in a style that matches the Ant and rake methods.

There is a lib-taskman project on the google code hosting where you can find the full documentation, sources and latest releases. It's probably not that elegant as rake but if you want to stick to PHP and have Ant-alike functionality without any XML programming then taskman may turn out to be handy. taskman is very simple to use, it requires only one include, all its code resides in one PHP file, and it has no external dependencies.

He includes a basic use example that sets up the build with "task_hello", "task_comma", "task_world" and "task_say" methods that each do some basic output to show the flow of the process. He also gives examples of possible uses for the tasks like database bootstrapping, auto-code generation, project deployment, etc. He also mentions two other PHP-based projects that do similar things - pake and Phake.

tagged: rake build tool taskman ant alternative phake pake

Link:

Mike Willbanks' Blog:
PHP Continuous Integration with Atlassian Bamboo
Mar 02, 2010 @ 16:51:42

Mike Willbanks as put together a new post talking about continuous integration with Atlassian's Bamboo software and getting it to cooperate with the needed PHP tools to round out your deployment (like PHP Depend, PHP Code Sniffer, PHP Mess Detector and PHPUnit).

Continuous integration is all the rage these days; you are unit testing your code are you not? During some consulting in January with the help of Sebastian Bergmann, from thePHP.cc, we setup continuous integration utilizing Atlassian Bamboo and received training on PHPUnit. Using Atlassian Bamboo for continuous integration will take you a bit to setup, however, I have found it to be an invaluable tool when utilizing the Atlassian stack (JIRA, Confluence, Crucible, Bamboo and Crowd).

He walks you through the process of getting the PHP tools installed (from PEAR packages) and includes links to two Bamboo plugins to help gather some metrics on the deployment process. He talks about the actual build tool (they went with ant), setting up the locations for where output and external dependencies will be stored and includes the ant build.xml file they use to tie it all together.

tagged: atlassian bamboo continuous integration ant deployment

Link:

Alexey Zakhlestins' Blog:
Pake: PHP5 project build system
Aug 04, 2009 @ 17:51:34

Alexey Zakhlestins has posted about a build system created by developers of the Symfony framework as PHP's answer to Make and Rake - Pake.

Often, while working on software projects, one finds, that there are repetitive tasks, which would be much easier to deal with, if automated. In the C/Unix world, this task is often solved by Make, Java programmers prefer Apache Ant, Ruby programmers use Rake. The fact, which is not commonly known, is, that PHP also has such instrument, and it is called Pake. It was originally created by authors of Symfony framework. Unfortunately, they never wrote any documentation, which killed adoption rates.

He shows what a sample "Pakefile.php" file might look like and links to the github page for his revamp of the project to add a few more helpers. You can also install it as a PEAR pacakge.

tagged: pake build system make ant rake

Link:

Felix Geisendörfer's Blog:
Agile Web development (with CakePHP)
Aug 14, 2006 @ 12:18:53

In an effort to improve the way that he's writing web applications, Felix Geisendörfer has looked around him and found some good tools to "help him on his way to agility" in his programming. In this new post, he recounts some of his findings so far.

So I've decided that, over the course of the next couple days (or weeks), I'll dedicate quite a bit of my time to explore ways to improve the way I write web applications. This includes getting into unit/integration testing, automating workflows, and also adopting better coding techniques.

He covers four software packages that he's found so far to help achieve this goal:

  • Apache Ant
  • SimpleTest for PHP
  • Selenium Remote Control
  • Selenium IDE

For each of the software in the list, he talks about what kinds of features they offer and how that relates back to his goal. There are also links to downloads and documentation for each of them for further reading.

tagged: agile web development cakephp framework ant simpletest selenium agile web development cakephp framework ant simpletest selenium

Link:

Felix Geisendörfer's Blog:
Agile Web development (with CakePHP)
Aug 14, 2006 @ 12:18:53

In an effort to improve the way that he's writing web applications, Felix Geisendörfer has looked around him and found some good tools to "help him on his way to agility" in his programming. In this new post, he recounts some of his findings so far.

So I've decided that, over the course of the next couple days (or weeks), I'll dedicate quite a bit of my time to explore ways to improve the way I write web applications. This includes getting into unit/integration testing, automating workflows, and also adopting better coding techniques.

He covers four software packages that he's found so far to help achieve this goal:

  • Apache Ant
  • SimpleTest for PHP
  • Selenium Remote Control
  • Selenium IDE

For each of the software in the list, he talks about what kinds of features they offer and how that relates back to his goal. There are also links to downloads and documentation for each of them for further reading.

tagged: agile web development cakephp framework ant simpletest selenium agile web development cakephp framework ant simpletest selenium

Link:

Community News:
GotAPI.com - A Gateway to Manuals
Apr 05, 2006 @ 20:59:48

When hard a work coding, browser windows with manual entries have a nasty habit of multiplying (at least when I work). So, neededless to say, I was happy to find GotAPI.com, a site that compiles the reference materials for several different web development languages into one handy browser window.

The page, by default, searches HTML resources, including the W3C specs and Microsoft's MSDN materials. Those and the w3schools website show up often in the other languages available - CSS, XSL, XML, and XPath. The PHP manual that's referenced is just pulled from the PHP.net site, but it's still nice to have it all right there.

When searching, a "suggeted terms" box pops up to help you narrow down the search faster. It searches not only the beginnings of the words for your term, but it looks inside them as well, matching anywhere.

It would be nice if the site had some kind of bookmarking system built into it - then you could keep a reference and just flip back and forth between the pages with a single click of the mouse.

tagged: manuals compile xsl xpath html css ant java manuals compile xsl xpath html css ant java

Link:


Trending Topics: