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.
author | Andreas Aderhold |
---|---|
author | Hans Lellelid |
version | $Id: 9d949a45b45bd04264dde71edde4424a7840a4ad $ |
package | phing |
__import(string $path, mixed $classpath)
string
Path to the PHP file
mixed
String or object supporting __toString()
\BuildException |
- if cannot find the specified file |
---|
clearCapturedPhpErrors()
currentTimeMillis()
execute(array $args) : void
array
commandline args passed to phing shell.
fire(array $args) : void
This method kicks off the building of a project object and executes a build using either a given target or the default target.
array
Command line args.
getCapturedPhpErrors() : array
array
array('message' => message, 'line' => line number, 'file' => file name, 'level' => error level)getCurrentProject() : \Project
\Project
Current Project or NULL if none is set yet/still.getDefinedProperty(string $name) : string
"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.
string
string
value of found property (or null, if none found).getMsgOutputLevel() : int
backtraces -- for "debug" level.
int
getOutputStream() : \OutputStream
getPhingVersion() : string
getProperties()
getProperty($propName) : string
System properties are "global" properties like application.startdir, and user.dir. Many of these correspond to similar properties in Java or Ant.
string
Value of found property (or null, if none found).getResourcePath($path) : string
string
File found (null if no file found).halt()
deprecated | This method is deprecated and is no longer called by Phing internally. Any normal shutdown routines are handled by the shutdown() method. |
---|---|
see | \global\shutdown() |
handlePhpError($level, $message, $file, $line)
This uses the logging for the currently configured project.
import(string $dotPath, mixed $classpath) : string
string
mixed
String or object supporting __toString()
\BuildException |
- if cannot find the specified file |
---|
string
The unqualified classname (which can be instantiated).log(string $message, int $priority)
If there is no currently-configured Project, then this will do nothing.
string
int
Project::MSG_INFO, etc.
printDescription(\Project $project)
printMessage(\Exception $t)
\Exception
printTargets($project)
printUsage()
printVersion()
runBuild() : void
setDefinedProperty(string $name, $value) : string
string
string
value of found property (or null, if none found).setErrorStream(\OutputStream $stream)
setOutputStream(\OutputStream $stream)
setProperty($propName, $propValue)
shutdown() : void
start(array $args, array $additionalUserProperties)
This method encapsulates the complete build lifecycle.
see | \global\execute() |
---|---|
see | \global\runBuild() |
array
The commandline args passed to phing shell script.
array
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
\Exception |
- if there is an error during build |
---|
startPhpErrorCapture()
While errors are being captured, they are not logged.
startup() : void
Sets up the Phing environment but does not initiate the build process.
\Exception |
- If the Phing environment cannot be initialized. |
---|
stopPhpErrorCapture()
The errors will once again be logged after calling this method.
unsetCurrentProject()
_findBuildFile(string $start, string $suffix) : \PhingFile
Takes the given target as a suffix to append to each parent directory in search of a build file. Once the root of the file-system has been reached an exception is thrown.
string
Start file path.
string
Suffix filename to look for in parents.
\BuildException |
Failed to locate a build file |
---|
\PhingFile
A handle to the build file_printTargets(array $names, array $descriptions, string $heading, int $maxlen)
array
The names to be printed. Must not be null
.
array
The associated target descriptions. May be null
, in which case no descriptions are displayed. If non-null
, this should have as many elements as names
.
string
The heading to display. Should not be null
.
int
The maximum length of the names of the targets. If descriptions are given, they are padded to this position so they line up (so long as the names really are shorter than this).
addBuildListeners(\Project $project) : void
This means adding the logger and any build listeners that were specified with -listener arg.
\Project
addInputHandler(\Project $project)
comparePhingVersion($version)
convertShorthand(string $val)
createLogger() : \BuildLogger
\BuildLogger
The created LoggerhandleLogfile()
since | Phing 2.3.0 |
---|
initializeOutputStreams()
restoreIni() : void
Currently the following settings are not restored: - max_execution_time (because getting current time limit is not possible) - memory_limit (which may have been increased by Phing)
setIncludePaths() : void
\ConfigurationException |
- if the include_path could not be set (for some bizarre reason) |
---|
setIni() : void
setSystemConstants() : void
$buildFile
$capturedPhpErrors
$currentProject
$definedProps : \Properties
$importPaths
$inputHandlerClassname
$isLogFileUsed : boolean
$listeners
$loggerClassname
$msgOutputLevel
Follows Project::MSG_XXX
$origIniSettings : array
$out : \OUtputStream
$phpErrorCapture
$projectHelp
$properties
$readyToRun
$targets
$timer
DEFAULT_BUILD_FILENAME