Documentation

Root
in package

Components_Helper_Root:: handles the root position for a tree of dependencies and takes the Horde component layout into account.

Copyright 2010-2020 Horde LLC (http://www.horde.org/)

See the enclosed file LICENSE for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.

Tags
category

Horde

author

Gunnar Wrobel wrobel@pardus.de

license

http://www.horde.org/licenses/lgpl21 LGPL 2.1

Table of Contents

$_component  : Component|null
$_errors  : array<string|int, mixed>
Errors that occured while trying to determine the root path.
$_options  : mixed
$_path  : mixed
$_root_path  : string
Root path of the Horde repository.
__construct()  : mixed
Constructor.
getGitIgnore()  : string
Return the contents of the gitignore file.
getPackageXml()  : 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|bool
Traverse the folder tree upwards to determine if a parent folder of the provided file path might be the Horde repository root.
_determineRoot()  : string
Try to determine the root path.
_determineRootFromComponent()  : string|bool
Try to determine the root path based on a component.
_determineRootFromCwd()  : string|bool
Try to determine the root path based on the current working directory.
_determineRootFromOptions()  : string|bool
Try to determine the root path based on the options.
_determineRootFromPath()  : string|bool
Try to determine the root path based on a fixed path.
_isValidRoot()  : string|bool
Test if the directory path could be the Horde repository root.

Properties

$_errors

Errors that occured while trying to determine the root path.

protected array<string|int, mixed> $_errors = []

$_options

protected mixed $_options = []

$_path

protected mixed $_path = null

$_root_path

Root path of the Horde repository.

protected string $_root_path

Methods

__construct()

Constructor.

public __construct([array<string|int, mixed> $_options = [] ][, Component $_component = null ][, string $_path = null ]) : mixed
Parameters
$_options : array<string|int, mixed> = []

If given the helper will try to determine the root of the Horde repository based on these options.

$_component : Component = null

If given the helper will try to determine the root of the Horde repository based on this component.

$_path : string = null

If given the helper will try to determine the root of the Horde repository based on this path.

Return values
mixed

getGitIgnore()

Return the contents of the gitignore file.

public getGitIgnore() : string
Tags
throws
Exception

If the Horde repository root could not be determined.

Return values
string

The information from the gitignore file.

getPackageXml()

Return the path to the package.xml for the package with the provided name.

public getPackageXml(string $name) : string
Parameters
$name : string

The name of the package.

Tags
throws
Exception

If the Horde repository root could not be determined.

Return values
string

The path to the package.xml of the requested package.

getRoot()

Return the root position of the repository.

public getRoot() : string
Tags
throws
Exception

If the Horde repository root could not be determined.

Return values
string

The root path.

traverseHierarchy()

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|bool
Parameters
$start : string

Path to the file to start from.

Return values
string|bool

The root path or false if it could not be determined.

_determineRoot()

Try to determine the root path.

private _determineRoot() : string
Tags
throws
Exception

If the Horde repository root could not be determined.

Return values
string

The root path.

_determineRootFromComponent()

Try to determine the root path based on a component.

private _determineRootFromComponent() : string|bool
Return values
string|bool

The root path or false if it could not be determined.

_determineRootFromCwd()

Try to determine the root path based on the current working directory.

private _determineRootFromCwd() : string|bool
Return values
string|bool

The root path or false if it could not be determined.

_determineRootFromOptions()

Try to determine the root path based on the options.

private _determineRootFromOptions() : string|bool
Return values
string|bool

The root path or false if it could not be determined.

_determineRootFromPath()

Try to determine the root path based on a fixed path.

private _determineRootFromPath() : string|bool
Return values
string|bool

The root path or false if it could not be determined.

_isValidRoot()

Test if the directory path could be the Horde repository root.

private _isValidRoot(string $directory) : string|bool
Parameters
$directory : string

Path to the directory to test.

Return values
string|bool

The root path or false if it could not be determined.

Search results