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.
Mostrar archivo Open project: horde/horde Class Usage Examples

Public Methods

Method 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

Method 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 method

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 method

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

getPackageXml() public method

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.
return string The path to the package.xml of the requested package.

getRoot() public method

Return the root position of the repository.
public getRoot ( ) : string
return string The root path.

traverseHierarchy() public method

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.
return string | boolean The root path or false if it could not be determined.