Ant build script for PHP projects. By default supports Jenkins and Symfony2.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Continuous Integration scripts for PHP project

This package includes ant build script for running

  • code metrics
  • documentation generation
  • automated tests

in command line and Jenkins CI software. Symfony2 support is offered out of the box, for other frameworks you have to customize the build.xml.

Command line usage

  1. Install QA tools from PEAR: pear config-set auto_discover 1 pear install
  2. Install ant
  3. Copy or symlink build.xml and build/ directory into project root folder.
  4. Modify script to point to your sources folder (src/ by default)
  5. Run specific build targets. Currently these command line targets are configured:
  • lint: Syntax check source files
  • phploc: Measure project size using PHPLOC
  • phpmd: Perform project mess detection using PHPMD
  • phpcs: Find coding standard violations using PHP_CodeSniffer (default standard is PSR-2)
  • phpcpd: Find duplicate code using PHPCPD

So, ant phpmd executed at the root folder of your project runs php mess detector and outputs report to shell.


  • PHPMD is configured by default to run with "Code Size", "Controversial" and "Design" rulesets. Add more rulesets by editing build/phpmd.xml file.
  • PHPCS is configured by default to check PSR-2 compliance. You can see installed rulesets by phpcs -i.

Jenkins usage

Buildfile is modified from Buildfile runs code metrics, generates documentation and runs automated PHPUnit tests.

  1. Goto Follow the instructions and install php-template to your Jenkins.
  2. Configure your project. Add build target "Invoke Ant", set targets as:

Symfony initialization target installs vendors and clears/warm-ups cache.

Additionally, there's jasmine-node target for running jasmine Javascript tests.