phing

# Class: Phing Source Location: /Phing.php
### Class Overview
Entry point into Phing. This class handles the full lifecycle of a build -- from parsing & handling commandline arguments to assembling the project to shutting down and cleaning up in the end. #### Author(s): Hans Lellelid <hans@xmpl.org> Andreas Aderhold <andi@binarycloud.com> #### Version: $Revision: 552 $ | ### Constants DEFAULT_BUILD_FILENAME | ### Methods clearCapturedPhpErrors currentTimeMillis execute fire getCapturedPhpErrors getCurrentProject getDefinedProperty getErrorStream getMsgOutputLevel getOutputStream getPhingVersion getProperties getProperty getResourcePath getTimer halt handlePhpError import log printDescription printMessage printTargets printUsage printVersion runBuild setCurrentProject setDefinedProperty setErrorStream setOutputStream setProperty shutdown start startPhpErrorCapture startup stopPhpErrorCapture unsetCurrentProject __import
### Class Details [line 64] Entry point into Phing. This class handles the full lifecycle of a build -- from parsing & handling commandline arguments to assembling the project to shutting down and cleaning up in the end. If you are invoking Phing from an external application, this is still the class to use. Your applicaiton can invoke the start() method, passing any commandline arguments or additional properties. #### Tags:
author: | Hans Lellelid <hans@xmpl.org>
author: | Andreas Aderhold <andi@binarycloud.com>
version: | $Revision: 552 $
[ Top ] ### Class Methods ### static method clearCapturedPhpErrors [line 754]
`static void clearCapturedPhpErrors( )`
Clears the captured errors without affecting the starting/stopping of the capture. #### Tags:
access: | public
[ Top ] ### static method currentTimeMillis [line 1215]
`static void currentTimeMillis( )`
#### Tags:
access: | public
[ Top ] ### static method fire [line 269]
`static void fire( array $args)`
Command line entry point. This method kicks off the building of a project object and executes a build using either a given target or the default target. #### Tags:
access: | public
#### Parameters:
array | $args | Command line args.
[ Top ] ### static method getCapturedPhpErrors [line 762]
`static array getCapturedPhpErrors( )`
Gets any PHP errors that were captured to buffer. #### Tags:
return: | array('message' => message, 'line' => line number, 'file' => file name, 'level' => error level)
access: | public
[ Top ] ### static method getCurrentProject [line 675]
`static Project getCurrentProject( )`
Gets the current Project. #### Tags:
return: | Current Project or NULL if none is set yet/still.
access: | public
[ Top ] ### static method getDefinedProperty [line 1162]
`static string getDefinedProperty( string $name)`
This gets a property that was set via command line or otherwise passed into Phing. "Defined" in this case means "externally defined". The reason this method exists is to provide a public means of accessing commandline properties for (e.g.) logger or listener scripts. E.g. to specify which logfile to use, PearLogger needs to be able to access the pear.log.name property. #### Tags:
return: | value of found property (or null, if none found).
access: | public
#### Parameters:
string | $name |
[ Top ] ### static method getErrorStream [line 235]
`static OutputStream getErrorStream( )`
Gets the stream to use for error output. #### Tags:
access: | public
[ Top ] ### static method getMsgOutputLevel [line 257]
`static int getMsgOutputLevel( )`
Making output level a static property so that this property can be accessed by other parts of the system, enabling us to display more information -- e.g. backtraces -- for "debug" level. #### Tags:
access: | public
[ Top ] ### static method getOutputStream [line 219]
`static OutputStream getOutputStream( )`
Gets the stream to use for standard (non-error) output. #### Tags:
access: | public
[ Top ] ### static method getPhingVersion [line 804]
`static string getPhingVersion( )`
Gets the current Phing version based on VERSION.TXT file. #### Tags:
throws: | BuildException - if unable to find version file.
access: | public
[ Top ] ### static method getProperties [line 1204]
`static void &getProperties( )`
Retuns reference to all properties #### Tags:
access: | public
[ Top ] ### static method getProperty [line 1185]
`static string getProperty( $propName, string $paramName)`
Returns property value for a System property. System properties are "global" properties like application.startdir, and user.dir. Many of these correspond to similar properties in Java or Ant. #### Tags:
return: | Value of found property (or null, if none found).
access: | public
#### Parameters:
string | $paramName |
| $propName |
[ Top ] ### static method getResourcePath [line 1025]
`static string getResourcePath( $path)`
Looks on include path for specified file. #### Tags:
return: | File found (null if no file found).
access: | public
#### Parameters:
| $path |
[ Top ] ### static method getTimer [line 1292]
`static Timer getTimer( )`
Returns reference to Timer object. #### Tags:
access: | public
[ Top ] ### static method halt [line 1325]
`static void halt( )`
Halts the system. #### Tags:
see: | Phing::shutdown()
deprecated: | This method is deprecated and is no longer called by Phing internally. Any normal shutdown routines are handled by the shutdown() method.
access: | public
[ Top ] ### static method handlePhpError [line 696]
`static void handlePhpError( $level, $message, $file, $line)`
Error handler for PHP errors encountered during the build. This uses the logging for the currently configured project. #### Tags:
access: | public
#### Parameters:
| $level |
| $message |
| $file |
| $line |
[ Top ] ### static method import [line 944]
`static string import( string $dotPath, [mixed $classpath = null])`
Import a dot-path notation class path. #### Tags:
return: | The unqualified classname (which can be instantiated).
throws: | BuildException - if cannot find the specified file
access: | public
#### Parameters:
string | $dotPath |
mixed | $classpath | String or object supporting __toString()
[ Top ] ### static method log [line 685]
`static void log( string $message, [int $priority = Project::MSG_INFO])`
A static convenience method to send a log to the current (last-setup) Project. If there is no currently-configured Project, then this will do nothing. #### Tags:
access: | public
#### Parameters:
string | $message |
int | $priority | Project::MSG_INFO, etc.
[ Top ] ### static method printDescription [line 829]
`static void printDescription( Project $project)`
Print the project description, if any #### Tags:
access: | public
#### Parameters:
Project | $project |
[ Top ] ### static method printMessage [line 184]
`static void printMessage( $t)`
Prints the message of the Exception if it's not null. #### Tags:
access: | public
#### Parameters:
Exception | $t |
[ Top ] ### static method printUsage [line 767]
`static void printUsage( )`
Prints the usage of how to use this class #### Tags:
access: | public
[ Top ] ### static method printVersion [line 795]
`static void printVersion( )`
Prints the current Phing version. #### Tags:
access: | public
[ Top ] ### static method setCurrentProject [line 660]
`static void setCurrentProject( Project $p)`
Sets the current Project #### Tags:
access: | public
#### Parameters:
Project | $p |
[ Top ] ### static method setDefinedProperty [line 1172]
`static string setDefinedProperty( string $name, $value)`
This sets a property that was set via command line or otherwise passed into Phing. #### Tags:
return: | value of found property (or null, if none found).
access: | public
#### Parameters:
string | $name |
| $value |
[ Top ] ### static method setErrorStream [line 227]
`static void setErrorStream( $stream)`
Sets the stream to use for error output. #### Tags:
access: | public
#### Parameters:
OutputStream | $stream | The stream to use for error output.
[ Top ] ### static method setOutputStream [line 211]
`static void setOutputStream( $stream)`
Sets the stream to use for standard (non-error) output. #### Tags:
access: | public
#### Parameters:
OutputStream | $stream | The stream to use for standard output.
[ Top ] ### static method setProperty [line 1208]
`static void setProperty( $propName, $propValue)`
#### Tags:
access: | public
#### Parameters:
| $propName |
| $propValue |
[ Top ] ### static method shutdown [line 1333]
`static void shutdown( )`
Performs any shutdown routines, such as stopping timers. #### Tags:
access: | public
[ Top ] ### static method start [line 153]
`static void start( array $args, [ $additionalUserProperties = null])`
Entry point allowing for more options from other front ends. This method encapsulates the complete build lifecycle. #### Tags:
see: | Phing::execute()
see: | Phing::runBuild()
throws: | Exception - if there is an error during build
access: | public
#### Parameters:
array | $args | The commandline args passed to phing shell script.
array | $additionalUserProperties | Any additional properties to be passed to Phing (alternative front-end might implement this). These additional properties will be available using the getDefinedProperty() method and will be added to the project's "user" properties
[ Top ] ### static method startPhpErrorCapture [line 738]
`static void startPhpErrorCapture( )`
Begins capturing PHP errors to a buffer. While errors are being captured, they are not logged. #### Tags:
access: | public
[ Top ] ### static method startup [line 1306]
`static void startup( )`
Start up Phing. Sets up the Phing environment but does not initiate the build process. #### Tags:
throws: | Exception - If the Phing environment cannot be initialized.
access: | public
[ Top ] ### static method stopPhpErrorCapture [line 747]
`static void stopPhpErrorCapture( )`
Stops capturing PHP errors to a buffer. The errors will once again be logged after calling this method. #### Tags:
access: | public
[ Top ] ### static method unsetCurrentProject [line 667]
`static void unsetCurrentProject( )`
Unsets the current Project #### Tags:
access: | public
[ Top ] ### static method __import [line 978]
`static void __import( string $path, [mixed $classpath = null])`
Import a PHP file #### Tags:
throws: | BuildException - if cannot find the specified file
access: | public
#### Parameters:
string | $path | Path to the PHP file
mixed | $classpath | String or object supporting __toString()
[ Top ] ### method execute [line 278]
`void execute( array $args)`
Setup/initialize Phing environment from commandline args. #### Tags:
access: | public
#### Parameters:
array | $args | commandline args passed to phing shell.
[ Top ] ### method printTargets [line 836]
`void printTargets( $project)`
Print out a list of all targets in the current buildfile #### Parameters:
| $project |
[ Top ] ### method runBuild [line 483]
`void runBuild( )`
Executes the build. [ Top ] ### Class Constants #### DEFAULT_BUILD_FILENAME = "build.xml" [line 67] The default build file name [ Top ] Documentation generated on Mon, 19 Oct 2009 10:51:32 +0200 by phpDocumentor 1.4.3