classes/phing/types/Path.php
\Path
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.
- Extends from
- \DataType
- author
- Hans Lellelid
(Phing) - author
- Thomas.Haas@softwired-inc.com (Ant)
- author
- Stefan Bodewig
(Ant) - package
- phing.types
- version
- $Revision: 526 $
Properties
Methods

__construct(
\Project $project
=
null, string $path
=
null
)
:
| Name | Type | Description |
|---|---|---|
| $project | \Project | |
| $path | string | (for use by IntrospectionHelper) |

__toString(
)
:
string| Type | Description |
|---|---|
| string |

addDirset(
$dset
)
:
<dirset> element.| Name | Type | Description |
|---|---|---|
| $dset |
- throws

addExisting(
\Path $source
)
:
| Name | Type | Description |
|---|---|---|
| $source | \Path |
|

addFileset(
$fs
)
:
<fileset> element.| Name | Type | Description |
|---|---|---|
| $fs |
- throws

append(
$other
)
:
| Name | Type | Description |
|---|---|---|
| $other |

dieOnCircularReference(
$stk, $p
)
:
| Name | Type | Description |
|---|---|---|
| $stk | ||
| $p |
- throws

listPaths(
)
:
array| Type | Description |
|---|---|
| array |

resolveFile(
$project, $relativeName
)
:
Assume the filename is absolute if project is null.
| Name | Type | Description |
|---|---|---|
| $project | ||
| $relativeName |

setDir(
\$location $location
)
:
| Name | Type | Description |
|---|---|---|
| $location | \$location | the location of the element to add (must not be |
- throws

setPath(
\path $path
)
:
| Name | Type | Description |
|---|---|---|
| $path | \path | the path definition. |
- throws

setRefid(
$r
)
:
You must not set another attribute or nest elements inside this element if you make it a reference.
| Name | Type | Description |
|---|---|---|
| $r |
- throws

size(
)
:
intDEV NOTE: expensive call! list is generated, counted, and then discareded.
| Type | Description |
|---|---|
| int |

translateFile(
$source
)
:
| Name | Type | Description |
|---|---|---|
| $source |

translateFileSep(
$buffer, $pos
)
:
| Name | Type | Description |
|---|---|---|
| $buffer | ||
| $pos |
\PathElement
Helper class, holds the nested <code><pathelement></code> values.
- package
- phing.types