This object represents a path as used by include_path or PATH environment variable.
This class has been adopted from the Java Ant equivalent. The ability have path structures in Phing is important; however, because of how PHP classes interact the ability to specify CLASSPATHs makes less sense than Java.Rather than providing CLASSPATH for any tasks that take classes as parameters, perhaps a better solution in PHP is to have an IncludePath task, which prepends paths to PHP's include_path INI variable. This gets around the problem that simply using a path to load the initial PHP class is not enough (in most cases the loaded class may assume that it is on the global PHP include_path, and will try to load dependent classes accordingly). The other option is to provide a way for this class to add paths to the include path, if desired -- or to create an IncludePath subclass. Once added, though, when would a path be removed from the include path?
<sometask>
<somepath>
<pathelement location="/path/to/file" />
<pathelement path="/path/to/class2;/path/to/class3" />
<pathelement location="/path/to/file3" />
</somepath>
</sometask>
The object implemention sometask
must provide a method called
createSomepath
which returns an instance of Path
.
Nested path definitions are handled by the Path object and must be labeled
pathelement
.
The path element takes a parameter path
which will be parsed
and split into single elements. It will usually be used
to define a path from an environment variable.
author |
Hans Lellelid hans@xmpl.org (Phing) |
---|---|
author |
Thomas.Haas@softwired-inc.com (Ant) |
author |
Stefan Bodewig stefan.bodewig@epost.de (Ant) |
package |
phing.types |
__construct(\Project $project = null, string $path = null)
__toString() : string
string
A textual representation of the path.
addDirset(\DirSet $dset) : void
addExisting(\Path $source) : void
addFileset(\FileSet $fs) : void
append(\Path $other) : void
circularReference() : \BuildException
createPathElement() : void
throws | |
---|---|
dieOnCircularReference( &$stk, \Project $p) : void
If one is included, throw a BuildException created by circularReference
This implementation is appropriate only for a DataType that cannot hold other DataTypes as children.
The general contract of this method is that it shouldn't do anything if checked is true and set it to true on exit.
throws |
---|
\Project
getCheckedRef( $requiredClass, $dataTypeName) : mixed
throws |
---|
mixed
getDescription()
retujrn |
string |
---|---|
getProject() : \Project
isReference() : boolean
boolean
listPaths() : array
throws | |
---|---|
array
List of path elements.
log(string $msg, integer $level = \Project::MSG_INFO) : void
string
The message to be logged.
integer
The message's priority at this message should have
noChildrenAllowed() : \BuildException
parsingComplete() : void
{@inheritdoc}
pushAndInvokeCircularReferenceCheck(\DataType $dt, &$stk, \Project $p)
resolveFile(\Project $project, $relativeName) : string
Assume the filename is absolute if project is null.
\Project
string
setDescription(string $desc) : void
string
setDir(\PhingFile $location) : void
throws |
---|
setPath( $path)
throws | |
---|---|
the path definition.
setProject(\Project $project) : void
setRefid(\Reference $r) : void
Subclasses may need to check whether any other attributes have been set as well or child elements have been created and thus override this method. if they do they must call parent::setRefid()
\Reference
size() : integer
DEV NOTE: expensive call! list is generated, counted, and then discareded.
integer
tooManyAttributes() : \BuildException
translateFile(string $source) : string
string
string
translateFileSep(string &$buffer, integer $pos) : boolean
string
integer
boolean
translatePath(\Project $project, string $source) : array
elements :
description : string
var |
---|
string
checked : boolean
Subclasses are responsible for setting this value to false if we'd need to investigate this condition (usually because a child element has been added that is a subclass of DataType).
var |
---|
boolean
project : \Project