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 andi@binarycloud.com |
---|---|
author |
Hans Lellelid hans@xmpl.org |
version |
$Id: 6a792d7bc81f6ac4c1bb3afc7e2e50b6f81ae378 $ |
package |
phing |
start(array $args, array $additionalUserProperties = null)
This method encapsulates the complete build lifecycle.
see | \execute() \runBuild() |
---|---|
throws |
|
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
printMessage(\Exception $t)
\Exception
initializeOutputStreams()
setOutputStream(\OutputStream $stream)
getOutputStream() : \OutputStream
setErrorStream(\OutputStream $stream)
getErrorStream() : \OutputStream
handleLogfile()
since |
Phing 2.3.0 |
---|
getMsgOutputLevel() : int
int
fire(array $args) : void
array
Command line args.
execute(array $args) : void
array
commandline args passed to phing shell.
_getParentFile(\PhingFile $file) : \PhingFile
_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.
throws |
Failed to locate a build file |
---|
string
Start file path.
string
Suffix filename to look for in parents.
\PhingFile
A handle to the build file
runBuild() : void
comparePhingVersion($version)
addBuildListeners(\Project $project) : void
This means adding the logger and any build listeners that were specified with -listener arg.
addInputHandler(\Project $project)
throws |
if a specified InputHandler class could not be loaded. |
---|
createLogger() : \BuildLogger
unsetCurrentProject()
getCurrentProject() : \Project
log(string $message, int $priority = \Project::MSG_INFO)
If there is no currently-configured Project, then this will do nothing.
string
int
Project::MSG_INFO, etc.
handlePhpError($level, $message, $file, $line)
This uses the logging for the currently configured project.
startPhpErrorCapture()
While errors are being captured, they are not logged.
stopPhpErrorCapture()
The errors will once again be logged after calling this method.
clearCapturedPhpErrors()
getCapturedPhpErrors() : array
array
array('message' => message, 'line' => line number, 'file' => file name, 'level' => error level)
printUsage()
printVersion()
getPhingVersion() : string
throws |
|
---|
string
printDescription(\Project $project)
printTargets($project)
_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).
import(string $dotPath, mixed $classpath = null) : string
throws |
|
---|
string
mixed
String or object supporting __toString()
string
The unqualified classname (which can be instantiated).
__import(string $path, mixed $classpath = null)
throws |
|
---|
string
Path to the PHP file
mixed
String or object supporting __toString()
getResourcePath($path) : string
string
File found (null if no file found).
explodeIncludePath(string|null $path = null) : array
If no path provided, uses current include_path. Works around issues that occur when the path includes stream schemas.
Pulled from Zend_Loader::explodeIncludePath() in ZF1.
copyright |
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) |
---|---|
license |
http://framework.zend.com/license/new-bsd New BSD License |
string|null
array
setSystemConstants() : void
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).
setDefinedProperty(string $name, $value) : string
string
string
value of found property (or null, if none found).
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).
getProperties()
setProperty($propName, $propValue)
currentTimeMillis()
setIncludePaths() : void
throws |
|
---|
convertShorthand(string $val)
see | \http://www.php.net/ini_get |
---|
string
setIni() : void
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)
startup() : void
Sets up the Phing environment but does not initiate the build process.
throws |
|
---|
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 | \shutdown() |
shutdown() : void
PHAR_ALIAS
DEFAULT_BUILD_FILENAME
msgOutputLevel :
buildFile :
targets :
definedProps : \Properties
listeners :
loggerClassname :
inputHandlerClassname :
readyToRun :
projectHelp :
importPaths :
properties :
timer :
currentProject :
phpErrorCapture :
capturedPhpErrors :
out : \OUtputStream
var |
Stream for standard output. |
---|
\OUtputStream
err : \OutputStream
isLogFileUsed : boolean
var |
Whether we are using a logfile. |
---|
boolean
origIniSettings : array
var |
Struct of array(setting-name => setting-value) |
---|---|
see |
array