phing is a free, open source build & deployment project written in PHP and released under LGPL-3.0. It has 1,163 GitHub stars, 318 forks and 6 open issues, and was last pushed 8 days ago. On this registry it ranks #59 of 84 tracked projects in Build & Deployment, with 5 head-to-head comparisons available.

What is phing?

PHing is a PHP project build system and build tool based on Apache Ant — the name expands to "PHing Is Not GNU make" — and it is meant for PHP teams that want to automate packaging, deployment, and testing through simple XML build files and extensible PHP "task" classes instead of ad hoc scripts.

What it is

PHing is an open-source build automation tool written in PHP and distributed under the LGPL-3.0 licence. It lives in the PHP ecosystem and follows the design of Apache Ant, so a build is described in an XML file rather than in a Makefile. Builds are described in a file such as build.xml, and the actual work is performed by tasks: the out-of-the-box operation modules shipped with the tool, plus custom tasks a team writes against an object-oriented PHP model. Phing 3.x is compatible with PHP 8.1 or later.

The concrete problem it solves is script sprawl. Teams that find themselves writing custom scripts to handle the packaging, deploying, or testing of their applications are the audience the project names directly. Instead of one-off shell or PHP scripts that each developer maintains separately, Phing gives those operations a declarative XML description built from reusable tasks, so the build logic is versioned next to the code and runs the same way for everyone. Phing 3 is a significant update with breaking changes compared to Phing 2, and those changes are documented in UPGRADING.md.

Key capabilities

  • Runs PHPUnit unit tests, including test result and coverage reports.
  • Performs file transformations such as token replacement, XSLT transformation, and template transformations.
  • Handles file system operations and interactive build support.
  • Executes SQL and performs SCM operations against Git, Subversion, and Mercurial.
  • Generates documentation through PhpDocumentor and ApiGen.
  • Defines builds in XML build files and extends behaviour through custom PHP task classes.
  • Ships as a Composer package (phing/phing), a Phar archive, a Docker image (phing/phing:3.0), and a GitHub Action (phingofficial/phing-github-action@v2.0.0).

Who uses it and how

  • PHP application teams that want releases packaged and deployed by a repeatable build rather than by manual steps.
  • Projects whose test suites need PHPUnit results and coverage reports produced as part of the same build.
  • Teams on Git, Subversion, or Mercurial that want checkout and SCM steps defined alongside compilation and tests.
  • CI pipelines, by wiring the official GitHub Action into a .github/workflow/phing.yml workflow.
  • Containerised environments, running the phing/phing:3.0 image against a mounted build.xml.

Getting started

The preferred installation is Composer: add phing/phing (the README shows 3.1.x-dev) to the require-dev or require section of composer.json and run composer install. Alternatives are downloading and running php phing-latest.phar, the experimental Docker image, or the official GitHub Action.

How it compares

PHing sits in the same space as the two tools it names: it keeps Apache Ant's XML build-file and task model while running inside PHP, and it covers the build automation ground that GNU make covers. For PHP projects that means one tool for build, test, documentation, and deployment steps rather than a Makefile plus separate shell scripts.

When to use it — and when not to

Choose PHing when the build is PHP-centric, the runtime is PHP 8.1 or newer, and the team wants build logic expressed in XML with PHP tasks it can extend. Teams upgrading from Phing 2 must first work through the breaking changes in UPGRADING.md, and the Docker image is explicitly marked experimental, so container-first shops should weigh that. Projects outside PHP gain little from it, and since the documentation lives on the project website rather than in the repository, expect to consult phing.info.

project readme (upstream, from github) — read inline

Phing

Phing CI Scrutinizer Code Quality codecov

Thank you for using PHING!

PHing Is Not GNU make; it's a PHP project build system or build tool based on Apache Ant. You can do anything with it that you could do with a traditional build system like GNU make, and its use of simple XML build files and extensible PHP "task" classes make it an easy-to-use and highly flexible build framework.

Features include running PHPUnit unit tests (including test result and coverage reports), file transformations (e.g. token replacement, XSLT transformation, template transformations), file system operations, interactive build support, SQL execution, SCM operations (Git, Subversion and Mercurial), documentation generation (PhpDocumentor, ApiGen) and much, much more.

If you find yourself writing custom scripts to handle the packaging, deploying, or testing of your applications, then we suggest looking at Phing. Pre-packaged with numerous out-of-the-box operation modules (tasks), and an easy-to-use OO model to extend or add your own custom tasks.

For more information and documentation, you can visit our official website at .

Phing 3

Phing 3 is a significant update with some breaking changes compared to Phing 2. For details, please refer to the UPGRADING.md file.

Supported PHP versions

Phing 3.x is compatible with PHP 8.1 or later.

Installation

  1. Composer

The preferred method to install Phing is through Composer. Add phing/phing to the require-dev or require section of your project's composer.json configuration file, and run 'composer install':

     {
         "require-dev": {
             "phing/phing": "3.1.x-dev"
         }
     }
  1. Phar

Download the Phar archive. The archive can then be executed by running:

     $ php phing-latest.phar
  1. Docker (experimental)

The official Phing Docker image can be found on Docker Hub.

To execute Phing inside a container and execute build.xml located in /home/user, run the following:

     $ docker run --rm -v /home/user:/opt phing/phing:3.0 -f /opt/build.xml
  1. Phing GitHub Action

The official GitHub action phingofficial/phing-github-action is available on GitHub Marketplace.

To Run a Phing Build as an action, you need to setup a .github/workflow/phing.yml workflow file and paste the following snipped:

 name: CI
 on: [ push ]
 jobs:
   build-test:
     runs-on: ubuntu-latest

     steps:
       - uses: actions/checkout@v2
       - name: Phing Build
         uses: phingofficial/phing-github-action@v2.0.0
         with:
           version: 3.0.0-alpha4
           user-properties: prop=FooBar
           targets: foo
           verbose: true

README for more info and documentation.

Documentation

Phing's documentation can be found at .

For the source of the documentation, go to .

Contact

Donations

Developing and maintaining Phing has cost many hours over the years. If you want to show your appreciation, you can use one of the following methods to donate something to the project maintainer, Michiel Rook:

Thank you!

Help us spot & fix bugs

We greatly appreciate it when users report issues or come up with feature requests. However, there are a few guidelines you should observe before submitting a new issue:

  • Make sure the issue has not already been submitted, by searching through the list of (closed) issues.
  • Support and installation questions should be asked on Twitter, Slack or IRC, not filed as issues.
  • Give a good description of the problem, this also includes the necessary steps to reproduce the problem!
  • If you have a solution - please tell us! This doesn't have to be code. We appreciate any snippets, thoughts, ideas, etc that can help us resolve the issue.

Issues can be reported on GitHub.

Pull requests

The best way to submit code to Phing is to make a Pull Request on GitHub. Please help us merge your contribution quickly and keep your pull requests clean and concise: squash commits and don't introduce unnecessary (whitespace) changes.

Phing's source code is formatted according to the PSR-2 standard.

Running the (unit) tests

If you'd like to contribute code to Phing, please make sure you run the tests before submitting your pull request. To successfully run all Phing tests, the following conditions have to be met:

  • PEAR installed, channel "pear.phing.info" discovered
  • Packages "python-docutils" and "subversion" installed
  • php.ini setting "phar.readonly" set to "Off"

Then, perform the following steps (on a clone/fork of Phing):

     $ composer install
     $ cd tests
     $ ../bin/phing

Licensing

This software is licensed under the terms you may find in the file named "LICENSE" in this directory.

Proud to use:

PhpStorm Logo

Contributing

We love contributions!

Thanks to all the people who already contributed!

Frequently asked questions

Is phing free to use?

phing is open source under the LGPL-3.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does phing do?

PHing Is Not GNU make; it's a PHP project build system or build tool based on Apache Ant.

What is phing written in?

phing is primarily written in PHP. Its source is publicly available at https://github.com/phingofficial/phing, and it has 1,163 GitHub stars.