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?
<
p>
<sometask>
<somepath>
<pathelement location="/path/to/file" />
<pathelement path="/path/to/class2;/path/to/class3" />
<pathelement location="/path/to/file3" />
</somepath>
</sometask>
<
p> 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
.
<
p>
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 |
version | $Id$ |
__clone()
__construct(\Project $project, string $path)
__toString() : string
string
A textual representation of the path.addDirset(\DirSet $dset)
addExisting(\Path $source)
Components that don't exist, aren't added.
addFileset(\FileSet $fs)
append(\Path $other)
circularReference()
inherited_from | \DataType::circularReference() |
---|
createPathElement()
\BuildException |
---|
dieOnCircularReference($stk, \Project $p)
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.
\BuildException |
---|
getCheckedRef($requiredClass, $dataTypeName)
inherited_from | \DataType::getCheckedRef() |
---|
getDescription()
inherited_from | \DataType::getDescription() |
---|
getProject() : \Project
inherited_from | \ProjectComponent::getProject() |
---|---|
inherited_from | \DataType::getProject() |
\Project
Reference to current porject objectisReference()
inherited_from | \DataType::isReference() |
---|
listPaths() : array
array
List of path elements.log(string $msg, integer $level)
inherited_from | \ProjectComponent::log() |
---|---|
inherited_from | \DataType::log() |
string
The message to be logged.
integer
The message's priority at this message should have
noChildrenAllowed()
inherited_from | \DataType::noChildrenAllowed() |
---|
parsingComplete() : void
inherited_from | \DataType::parsingComplete() |
---|
setDescription($desc)
It will be useful in commenting what we are doing.
inherited_from | \DataType::setDescription() |
---|
setDir(\PhingFile $location)
the location of the element to add (must not be null
nor empty.
\BuildException |
---|
setPath(\path $path)
setProject(\Project $project)
inherited_from | \ProjectComponent::setProject() |
---|---|
inherited_from | \DataType::setProject() |
setRefid(\Reference $r) : void
You must not set another attribute or nest elements inside this element if you make it a reference.
\Reference
\BuildException |
---|
size() : int
DEV NOTE: expensive call! list is generated, counted, and then discareded.
int
tooManyAttributes()
inherited_from | \DataType::tooManyAttributes() |
---|
translateFile($source)
translatePath(\Project $project, string $source)
translateFileSep($buffer, $pos)
resolveFile(\Project $project, $relativeName)
Assume the filename is absolute if project is null.
$description
inherited_from | \DataType::$$description |
---|
$ref
Type of Reference
inherited_from | \DataType::$$ref |
---|
$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).
inherited_from | \DataType::$$checked |
---|
$project : \Project
inherited_from | \ProjectComponent::$$project |
---|---|
inherited_from | \DataType::$$project |
$elements