PHP Class Horde_Vcs_Directory_Base, horde

Copyright 2008-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.
Author: Anil Madhavapeddy ([email protected])
Author: Michael Slusarz ([email protected])
Author: Jan Schneider ([email protected])
Datei anzeigen Open project: horde/horde Class Usage Examples

Protected Properties

Property Type Description
$_dirName string The directory's path inside the repository.
$_dirs array A (string) list of directories inside this directory.
$_files array A list of Horde_Vcs_File_Base objects representing all files inside this directory.
$_rep Horde_Vcs_Base The directory's repository object.

Public Methods

Method Description
__construct ( Horde_Vcs_Base $rep, string $dn, array $opts = [] ) Constructor.
_fileAgeSort ( $a, $b ) Sort function for ascending age.
_fileAuthorSort ( $a, $b ) Sort function by author name.
_fileNameSort ( $a, $b ) Sort function for ascending filename.
_fileRevSort ( $a, $b ) Sort function for ascending revision.
applySort ( integer $how = Horde_Vcs::SORT_NONE, integer $dir = Horde_Vcs::SORT_ASCENDING ) Sorts the the directory contents.
getBranches ( ) : array Returns a list of all branches in this directory.
getDirectories ( ) Returns a list of directories inside this directory.
getFiles ( $showdeleted = false ) : array Returns a list of all files inside this directory.

Protected Methods

Method Description
_doFileSort ( array &$fileList, integer $how = Horde_Vcs::SORT_NONE ) Sorts a list files.

Method Details

__construct() public method

Constructor.
public __construct ( Horde_Vcs_Base $rep, string $dn, array $opts = [] )
$rep Horde_Vcs_Base A repository object.
$dn string Path to the directory.
$opts array Any additional options:

_doFileSort() protected method

Sorts a list files.
See also: applySort()
protected _doFileSort ( array &$fileList, integer $how = Horde_Vcs::SORT_NONE )
$fileList array A list of files.
$how integer A Horde_Vcs::SORT_* constant.

_fileAgeSort() public method

Sort function for ascending age.
public _fileAgeSort ( $a, $b )

_fileAuthorSort() public method

Sort function by author name.
public _fileAuthorSort ( $a, $b )

_fileNameSort() public method

Sort function for ascending filename.
public _fileNameSort ( $a, $b )

_fileRevSort() public method

Sort function for ascending revision.
public _fileRevSort ( $a, $b )

applySort() public method

Sorts the the directory contents.
public applySort ( integer $how = Horde_Vcs::SORT_NONE, integer $dir = Horde_Vcs::SORT_ASCENDING )
$how integer A Horde_Vcs::SORT_* constant where * can be: NONE, NAME, AGE, REV for sorting by name, age or revision.
$dir integer A Horde_Vcs::SORT_* constant where * can be: ASCENDING, DESCENDING for the order of the sort.

getBranches() public method

Returns a list of all branches in this directory.
public getBranches ( ) : array
return array A branch list.

getDirectories() public method

return array A (string) list of directories.
public getDirectories ( )

getFiles() public method

Returns a list of all files inside this directory.
public getFiles ( $showdeleted = false ) : array
return array A list of Horde_Vcs_File_Base objects.

Property Details

$_dirName protected_oe property

The directory's path inside the repository.
protected string $_dirName
return string

$_dirs protected_oe property

A (string) list of directories inside this directory.
protected array $_dirs
return array

$_files protected_oe property

A list of Horde_Vcs_File_Base objects representing all files inside this directory.
protected array $_files
return array

$_rep protected_oe property

The directory's repository object.
protected Horde_Vcs_Base $_rep
return Horde_Vcs_Base