Getting And Installing Phing

To get Phing you will need to have PEAR installed along with PHP. On a Windows system you can install PEAR by running the go-pear.bat file and running through the prompts there.

To get Phing just run the following commands.

pear channel-discover pear.phing.info
pear install phing/phing

You should see the install output looking like this:

downloading phing-current.tgz ...
Starting to download phing-current.tgz (361,527 bytes)
.........................................................................done: 361,527 bytes
install ok: channel://pear.php.net/phing-2.1.1

You can now run Phing by typing the following command:

phing

However, this will automatically try to find a file in the current directory called build.xml, and if it doesn't find this file it will simply state the following:

Buildfile: build.xml does not exist!

Before stopping. This build.xml file (although it doesn't have to be called this) is what controls what phing will do and is what you will spend most of your time looking at.

You can view which version of phing you are running by using the -v parameter.

phing -v

Which prints out something like:

Phing version 2.1.1

To view a list of available commands use the -h parameter.

phing -h

Which will print out:

phing [options] [target [target2 [target3] ...]]
Options:
  -h -help               print this message
  -l -list               list available targets in this project
  -v -version            print the version information and exit
  -q -quiet              be extra quiet
  -verbose               be extra verbose
  -debug                 print debugging information
  -logfile <file>        use given file for log
  -logger <classname>    the class which is to perform logging
  -f -buildfile <file>   use given buildfile
  -D<property>=<value>   use value for given property
  -find <file>           search for buildfile towards the root of the
                         filesystem and use it
 
Report bugs to <dev@phing.tigris.org>

Automated Build With Phing

Share:

  • Add news feed
  • Bookmark this on Delicious

Comments

build.xml

All works well but how to create build.xml ?
philipnorton42's picture

I have written a bit about

I have written a bit about creating the build.xml file, This post should get you started: http://www.hashbangcode.com/blog/introduction-phing-buildxml-file-304.html This post has an index of the things I have written about Phing on this site. http://www.hashbangcode.com/blog/automated-build-phing-302.html

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <h2> <h3> <h4> <h5> <h6> <pre> <span> <p> <br />
  • Syntax highlight code surrounded by the {syntaxhighlighter SPEC}...{/syntaxhighlighter} tags, where SPEC is a Syntaxhighlighter options string or "class="OPTIONS" title="the title".

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.