[ Index ]
 

Code source de Symfony 1.0.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/vendor/phing/types/ -> Path.php (sommaire)

(pas de description)

Poids: 456 lignes (15 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 2 classes

Path:: (19 méthodes):
  __construct()
  setDir()
  setPath()
  setRefid()
  createPathElement()
  addFileset()
  addDirset()
  createPath()
  append()
  addExisting()
  listPaths()
  __toString()
  translatePath()
  translateFile()
  translateFileSep()
  size()
  __clone()
  dieOnCircularReference()
  resolveFile()

PathElement:: (4 méthodes):
  __construct()
  setDir()
  setPath()
  getParts()


Classe: Path  - X-Ref

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>
<code>
&lt;sometask&gt;<br>
&nbsp;&nbsp;&lt;somepath&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;pathelement location="/path/to/file" /&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;pathelement path="/path/to/class2;/path/to/class3" /&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;pathelement location="/path/to/file3" /&gt;<br>
&nbsp;&nbsp;&lt;/somepath&gt;<br>
&lt;/sometask&gt;<br>
</code>
<p>
The object implemention <code>sometask</code> must provide a method called
<code>createSomepath</code> which returns an instance of <code>Path</code>.
Nested path definitions are handled by the Path object and must be labeled
<code>pathelement</code>.<p>

The path element takes a parameter <code>path</code> which will be parsed
and split into single elements. It will usually be used
to define a path from an environment variable.

__construct($project = null, $path = null)   X-Ref
Constructor for internally instantiated objects sets project.

param: Project $project
param: string $path (for use by IntrospectionHelper)

setDir(PhingFile $location)   X-Ref
Adds a element definition to the path.

param: $location the location of the element to add (must not be

setPath($path)   X-Ref
Parses a path definition and creates single PathElements.

param: path the path definition.

setRefid(Reference $r)   X-Ref
Makes this instance in effect a reference to another Path instance.

<p>You must not set another attribute or nest elements inside
this element if you make it a reference.</p>

createPathElement()   X-Ref
Creates the nested <code>&lt;pathelement&gt;</code> element.


addFileset(FileSet $fs)   X-Ref
Adds a nested <code>&lt;fileset&gt;</code> element.


addDirset(DirSet $dset)   X-Ref
Adds a nested <code>&lt;dirset&gt;</code> element.


createPath()   X-Ref
Creates a nested <code>&lt;path&gt;</code> element.


append(Path $other)   X-Ref
Append the contents of the other Path instance to this.


addExisting(Path $source)   X-Ref
Adds the components on the given path which exist to this
Path. Components that don't exist, aren't added.

param: Path $source - Source path whose components are examined for existence.

listPaths()   X-Ref
Returns all path elements defined by this and nested path objects.

return: array List of path elements.

__toString()   X-Ref
Returns a textual representation of the path, which can be used as
CLASSPATH or PATH environment variable definition.

return: string A textual representation of the path.

translatePath(Project $project, $source)   X-Ref
Splits a PATH (with : or ; as separators) into its parts.

param: Project $project
param: string $source

translateFile($source)   X-Ref
Returns its argument with all file separator characters
replaced so that they match the local OS conventions.


translateFileSep(&$buffer, $pos)   X-Ref
Translates all occurrences of / or \ to correct separator of the
current platform and returns whether it had to do any
replacements.


size()   X-Ref
How many parts does this Path instance consist of.
DEV NOTE: expensive call! list is generated, counted, and then
discareded.

return: int

__clone()   X-Ref
Return a Path that holds the same elements as this instance.


dieOnCircularReference(&$stk, Project $p)   X-Ref
Overrides the version of DataType to recurse on all DataType
child elements that may have been added.


resolveFile(Project $project, $relativeName)   X-Ref
Resolve a filename with Project's help - if we know one that is.

<p>Assume the filename is absolute if project is null.</p>

Classe: PathElement  - X-Ref

Helper class, holds the nested <code>&lt;pathelement&gt;</code> values.

__construct(Path $outer)   X-Ref
Pas de description

setDir(PhingFile $loc)   X-Ref
Pas de description

setPath($path)   X-Ref
Pas de description

getParts()   X-Ref
Pas de description



Généré le : Fri Mar 16 22:42:14 2007 par Balluche grâce à PHPXref 0.7