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 |
package |
phing |
__import(string $path, mixed $classpath = null)
throws | |
---|---|
string
Path to the PHP file
mixed
String or object supporting __toString()
_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 |
---|
string
Start file path.
string
Suffix filename to look for in parents.
\PhingFile
A handle to the build file
_getParentFile(\PhingFile $file) : \PhingFile
_printTargets(array $names, array $descriptions, string $heading, integer $maxlen)
array
The names to be printed.
Must not be <code>null</code>.
array
The associated target descriptions.
May be <code>null</code>, in which case
no descriptions are displayed.
If non-<code>null</code>, this should have
as many elements as <code>names</code>.
string
The heading to display.
Should not be <code>null</code>.
integer
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
<i>are</i> shorter than this).
addBuildListeners(\Project $project) : void
This means adding the logger and any build listeners that were specified with -listener arg.
throws |
---|
\Project
addInputHandler(\Project $project)
clearCapturedPhpErrors()
comparePhingVersion(string $version) : integer|void
throws |
---|
string
integer|void
convertShorthand(string $val) : integer|string
createLogger() : \BuildLogger
currentTimeMillis() : float
float
execute(array $args) : void
throws |
---|
array
commandline args passed to phing shell.
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
fire(array $args) : void
array
Command line args.
getCapturedPhpErrors() : array
array
array('message' => message, 'line' => line number, 'file' => file name, 'level' => error level)
getCurrentProject() : \Project
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).
getErrorStream() : \OutputStream
getGitInformation(string $path) : boolean|string
string
boolean|string
getMsgOutputLevel() : integer
integer
getOutputStream() : \OutputStream
getPhingVersion() : string
throws | |
---|---|
string
getProperties()
getProperty(string $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
string
Value of found property (or null, if none found).
getResourcePath(string $path) : string
string
string
File found (null if no file found).
halt()
deprecated |
This method is deprecated and is no longer called by Phing internally. Any
|
---|---|
see | \Phing::shutdown() |
handleLogfile() : void
since |
Phing 2.3.0 |
---|---|
handlePhpError( $level, string $message, $file, $line)
This uses the logging for the currently configured project.
string
import(string $dotPath, mixed $classpath = null) : string
throws |
|
---|
string
Path
mixed
String or object supporting __toString()
string
The unqualified classname (which can be instantiated).
initializeOutputStreams()
log(string $message, integer $priority = \Project::MSG_INFO)
If there is no currently-configured Project, then this will do nothing.
string
integer
Project::MSG_INFO, etc.
printDescription(\Project $project)
printMessage(\Exception $t)
\Exception
printTargets( $project)
printUsage()
printVersion()
restoreIni() : void
Currently the following settings are not restored:
runBuild() : void
throws | |
---|---|
setDefinedProperty(string $name, mixed $value) : mixed
string
mixed
mixed
value of found property (or null, if none found).
setErrorStream(\OutputStream $stream)
setIncludePaths() : void
throws |
|
---|---|
setIni() : void
setOutputStream(\OutputStream $stream)
setProperty( $propName, $propValue) : string
string
setSystemConstants() : void
shutdown() : void
start(array $args, array $additionalUserProperties = null)
This method encapsulates the complete build lifecycle.
see | \Phing::execute() \Phing::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
startPhpErrorCapture()
While errors are being captured, they are not logged.
startup() : void
Sets up the Phing environment but does not initiate the build process.
throws |
|
---|---|
stopPhpErrorCapture()
The errors will once again be logged after calling this method.
unsetCurrentProject()
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