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

Running a php server in Phing

I want to run a task in Phing where I first run the PHP server and then run a PHP Unit test. This is what I have so far:
Yahya Uddin
  • 26,997
  • 35
  • 140
  • 231
0
votes
1 answer

Unable to use here-document delimited by EOF within phing XML

I have some commands to be run after switching to a different user. I need to do this in a build xml file. Following is what I have done -
Sandeepan Nath
  • 9,966
  • 17
  • 86
  • 144
0
votes
2 answers

Hudson failing build w/o revealing cause

Every build has failed as of Tuesday. I'm not exactly sure what happened. The Phing targets (clean/prepare) are being executed properly. Additionally, the unit tests are passing with flying colors, with only a warning for duplicate code (not a…
webjawns.com
  • 2,300
  • 2
  • 14
  • 34
0
votes
0 answers

Git command invoked via phing is asking for credentials even though private-public key authentication to git server is in place

Public private key authentication has been setup for my user "sandeepan" to access the repository hosted on gitlab. I can run git fetch/pull commands on this server. However, when I run a fetch command via a phing xml file, I get a prompt to enter…
Sandeepan Nath
  • 9,966
  • 17
  • 86
  • 144
0
votes
1 answer

Phing: Group targets which are listed by "phing -l"

Is there a possibility to separate the targets in the build.xml file which are listed by the following command?: phing -l Because currently I see all targets under the "Main targets" headline. I would like to have several groups. Like "Database",…
technergy
  • 259
  • 1
  • 12
0
votes
2 answers

Adding suffix to a list with foreach

I am including a .properties file, which has a list of properties: configuration.files = file1, file2 configuration.files.file1.source = config/filename1 configuration.files.file2.source = config/filename2 Now I need the paths for each…
Heisoka
  • 90
  • 6
0
votes
1 answer

Configuration and content management with automated deployment tools for ZF based app

I am trying to automate deployments of a particular project and a bit lost as to who to handle config file as well as user assets. (Application is based on Zend Framework based btw). Main application folder is structured as follows: ./app …
Alex N.
  • 14,805
  • 10
  • 46
  • 54
0
votes
1 answer

Ending target early in Phing

I am trying to modify a Phing script and cannot see what I thought would be an obvious feature. The Phing script has a generic 'confirm' target which checks for input at various stages of execution. I want to automate the script so that it can run…
Steve E.
  • 9,003
  • 6
  • 39
  • 57
0
votes
2 answers

How to take local working directory to any git revision irrespective of its branch after remote changes?

Background I am working on a phing build script, which takes input as the target revision to which the production codebase needs to be taken. I am preparing the same in a separate scratchpad directory and then overwriting the production…
Sandeepan Nath
  • 9,966
  • 17
  • 86
  • 144
0
votes
1 answer

Unable to run ssh command using phing exec tag

I have the following exec tag in my build xml file - Running the build gives me error on this line - BUILD…
Sandeepan Nath
  • 9,966
  • 17
  • 86
  • 144
0
votes
1 answer

How do I replace the value against a key in a configuration file via phing build?

When I run the build, I want to search for a config key rollbackversion in a config file and replace the value against it (null) with the current branch of the deployment server (prior to rollout). This is how I am storing the values - destination…
Sandeepan Nath
  • 9,966
  • 17
  • 86
  • 144
0
votes
1 answer

Push rejected after deleting a branch and creating one by the same name and trying to push it

Problem Description I deleted this branch named "cert1", then added a branch with the same name and committed it (probably before pushing the delete action). Then, while trying to push this, I get this error - ! [rejected] cert1 -> cert1…
Sandeepan Nath
  • 9,966
  • 17
  • 86
  • 144
0
votes
2 answers

How to avoid CopyTask and MoveTask phing build exception on not existing file

I'm creating build file for phing. The problem is that it must move a file which may not exist. If it doesn't I get BuildException "Could not find file ... to copy". In the Ant there was a property failonerror which ignored the errors of move and…
Gedrox
  • 3,592
  • 1
  • 21
  • 29
0
votes
1 answer

Unexpected tag in top-level of build file in Jenkins build

I have Jenkins 1.624 to automate a build for Drupal 7. Below are the details required: Git Version: 1.9.1 Apache Ant Version: 1.9.6 Jenkins Version: 1.624 Drupal Version: 7.X Whenever I 'build now', it starts to build but fails with the below…
AkiShankar
  • 332
  • 5
  • 16
0
votes
1 answer

Invoking a URL and retrieving the rendered HTML page in Phing

So this is my dilemma - I am using the excellent codeigniter-simpletest library by Eric Barnes (http://github.com/ericbarnes/codeigniter-simpletest). Its perfect for my purposes, as it adds an endpoint onto the test deployment of my CodeIgniter…
ubermensch
  • 902
  • 1
  • 12
  • 21