3.5 Calling Phing

Now you are prepared to execute Phing on the command line or via script files. The following section briefly describe how to properly execute phing.

3.5.1 Command Line

Phing execution on the command line is simple. Just change to the directory where your buildfile resides and type

$ phing [target [target2 [target3] ...]]

at the command line (where [target...] are the target(s) you want to be executed). If no target is specified Phing will try to execute the default target, as specified in the project tag. When calling multipe targets, Phing will invoke each target independently of the other targets. Optionally, you may specify command line arguments as listed in Appendix A.

For example, the following command line calls the default buildscript build.xml using the default target with the property ftp.upload set to true.

$ phing -Dftp.upload=true

3.5.2 Supported command line arguments

As of version 2.4.9 the following command line arguments are supported

  -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
  -longtargets           show target descriptions during build
  -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
  -propertyfile <file>   load all properties from file
  -find <file>           search for buildfile towards the root of the
                         filesystem and use it
  -inputhandler <file>   the class to use to handle user input