Questions tagged [phing]

Phing is a project build system based on Apache ant. You can do anything with Phing that you could do with a traditional build system like Gnu make, and Phing's use of simple XML build files and extensible PHP "task" classes make it an easy-to-use and highly flexible build framework.

Phing is a project build system based on Apache ant. You can do anything with Phing that you could do with a traditional build system like Gnu make, and Phing's use of simple XML build files and extensible PHP "task" classes make it an easy-to-use and highly flexible build framework. Phing comes packaged with numerous out-of-the-box operation modules (tasks), and an easy-to-use OO model for adding your own custom tasks. (copied from the Phing documentation)

Phing provides the following features:

  • Simple XML buildfiles
  • Rich set of provided tasks
  • Easily extendable via PHP classes
  • Platform-independent: works on UNIX, Windows, MacOSX
  • No required external dependencies
  • Built & optimized for ZendEngine2/PHP5

Useful resources:

Hello World Example

Contents of build.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project name="HelloWorld" default="world" basedir=".">
    <target name="world" depends="message">
        <echo message="World!" />
    </target>
    <target name="message">
        <echo message="Hello, " />
    </target>
</project>

Executed by running phing or phing world

$ phing world
Buildfile: /tmp/phingtest/build.xml

HelloWorld > message:

     [echo] Hello, 

HelloWorld > world:

     [echo] World!

BUILD FINISHED

Total time: 0.0940 seconds

Installing via Composer

{
    "require": {
        "phing/phing": "2.5.0"
    },
}
384 questions
0
votes
1 answer

FileSystem::unlink() FAILED in PHING build-file

I've cloned a git repo in a new build folder with phing. Now I try to delete the .git-folder from my cloned repo with But when I do that the task fail with this…
Gerrit
  • 2,515
  • 5
  • 38
  • 63
0
votes
2 answers

Checking for existence of a file type in phing

I am writing a build script in Phing and want to have an if statement which tests for the existence of any files with a given extension in a directory (.sql files in this case). I have tried to do this with as shown below, with no luck…
AndrewD
  • 451
  • 3
  • 13
0
votes
0 answers

phpunit fail using phing

I'm using jenkins to build and test my php application, for the build I use phing because it's written in PHP (instead of ant..) here is a part of my build file :
sexybee
  • 24
  • 5
0
votes
1 answer

Error when trying to install packages using Pear

I have been trying unsuccessfully to install some pear packages for hours. I first tried to install phing to no avail then I tried installing it with the -alldeps flag still to no hope. I then tried installing phpUnit but I got the same error I got…
mojo706
  • 123
  • 6
0
votes
1 answer

java error with Jenkins for PHP development - FATAL: com/google/inject/Module

I have set up a continuous integration environment for PHP using Jenkins on Ubuntu 12.04. I have most of the PHP tools bedded down and being successfully invoked, However, all my builds are resulting in a Java error. My searching on the 'Net is not…
crafter
  • 6,246
  • 1
  • 34
  • 46
0
votes
0 answers

Add variable environment to PATH in Jenkins

I have a Jenkins set up on a remote server (linux) and I need to add a variable environment (to use Phing, or anything else, as my question is not related to this specific tool). This is what I tried : Configure Jenkins server -> Global properties…
Mick
  • 5
  • 2
  • 5
0
votes
1 answer

Phing SSH Agent forwarding

Phing running on Server A, with this SSH task to connect to server B:
jontyc
  • 3,445
  • 6
  • 29
  • 36
0
votes
1 answer

Phing + PHPDocumentor: BuildException: Error including PhpDocumentor setup class file "Setup.inc.php"

Phing Version: 2.6.1 PHP Documentor Version: 2.2.0 PEAR Version: 1.9.4 PHP Version: 5.4.17 When I run my build file everything runs smoothly until the phpdoc execution which throws a BuildException: Error including PhpDocumentor setup class file.…
Frank Martin
  • 1,611
  • 1
  • 14
  • 18
0
votes
2 answers

How to set an environment variable before running Phing target command

I've been trying to convert a command I run in bash to start a resque consumer using Phing but I couldn't find a way to set environment variables before exec the php command. This is the command I'm trying to convert: APPLICATION_ENV=dev VVERBOSE=1…
mjsilva
  • 1,327
  • 3
  • 13
  • 21
0
votes
1 answer

Phing echo filename specific extension

Is there a way in phing on which I can echo all the filenames inside specific folder specifying to get all ".php" extensions? folder-to-check | - file-to-get1.php - file-to-get2.php - otherfile.avi - otherfolder
warshafts
  • 45
  • 3
0
votes
1 answer

Phing task fails due to space in path

When trying to write a php code sniffer log to a path that contains spaces I get this error: [exec] ERROR: The file "calendar/build/checkstyle-codesniffer.xml" does not exist. The full path of the file is /home/jenkins/ci/workspace/full…
0
votes
1 answer

Capistrano and Phing

I've got some trouble to execute a phing script with capistrano v3. This is what I got so far. desc 'build' task :build do on roles(:web) do within release_path do execute "cd", "#{release_path}/build", "&&", "phing build" …
Leon Weemen
  • 364
  • 1
  • 5
  • 17
0
votes
2 answers

Check PHP Errors (Syntax & Fatal Error & Warnings) during build

While writing a phing xml code to build a php project. Is there any way to find errors in particular project file using phing xml. We found the code as below only throw alert for syntax error we need to filter it for all php errors like fatal errors…
Abdul Vahaf
  • 360
  • 2
  • 5
  • 10
0
votes
1 answer

how to make shorthand commands using phing

Suppose I have an executable for, e. g. Behat (doesn't matter, though) inside vendor/bin/ under root of my codebase. Its config lies under build/configs/and the test specs lie under tests/suites/acceptance/. All this directories are under root of…
hijarian
  • 2,159
  • 1
  • 28
  • 34
0
votes
1 answer

Phing phpunit "plugin with stackIndex "1" already registered" error

For my Zend Framework (v1.12) project deployment Im using Phing. It deploys front-end and back-end applications. Everything goes fine, untill Phing starts phpunit testing:
Bounce
  • 2,066
  • 6
  • 34
  • 65