PHP Class Components_Helper_Root, horde

Copyright 2010-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Afficher le fichier Open project: horde/horde Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( array $opts = [], Components_Component $comp = null, string $path = null ) Constructor.
getGitIgnore ( ) : string Return the contents of the gitignore file.
getPackageXml ( string $name ) : string Return the path to the package.xml for the package with the provided name.
getRoot ( ) : string Return the root position of the repository.
traverseHierarchy ( string $start ) : string | boolean Traverse the folder tree upwards to determine if a parent folder of the provided file path might be the Horde repository root.

Private Methods

Méthode Description
_determineRoot ( ) : string Try to determine the root path.
_determineRootFromComponent ( ) : string | boolean Try to determine the root path based on a component.
_determineRootFromCwd ( ) : string | boolean Try to determine the root path based on the current working directory.
_determineRootFromOptions ( ) : string | boolean Try to determine the root path based on the options.
_determineRootFromPath ( ) : string | boolean Try to determine the root path based on a fixed path.
_isValidRoot ( string $directory ) : string | boolean Test if the directory path could be the Horde repository root.

Method Details

__construct() public méthode

Constructor.
public __construct ( array $opts = [], Components_Component $comp = null, string $path = null )
$opts array If given the helper will try to determine the root of the Horde repository based on these options.
$comp Components_Component If given the helper will try to determine the root of the Horde repository based on this component.
$path string If given the helper will try to determine the root of the Horde repository based on this path.

getGitIgnore() public méthode

Return the contents of the gitignore file.
public getGitIgnore ( ) : string
Résultat string The information from the gitignore file.

getPackageXml() public méthode

Return the path to the package.xml for the package with the provided name.
public getPackageXml ( string $name ) : string
$name string The name of the package.
Résultat string The path to the package.xml of the requested package.

getRoot() public méthode

Return the root position of the repository.
public getRoot ( ) : string
Résultat string The root path.

traverseHierarchy() public méthode

Traverse the folder tree upwards to determine if a parent folder of the provided file path might be the Horde repository root.
public traverseHierarchy ( string $start ) : string | boolean
$start string Path to the file to start from.
Résultat string | boolean The root path or false if it could not be determined.