PHP Class Horde_Vcs_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.
Afficher le fichier Open project: horde/horde Class Usage Examples

Méthodes publiques

Свойство Type Description
$sourceroot string The source root of the repository.

Protected Properties

Свойство Type Description
$_cache Horde_Cache If caching is desired, a Horde_Cache object.
$_cacheVersion integer Current cache version.
$_diffTypes array The available diff types.
$_driver string The current driver.
$_features array Driver features.
$_paths array Hash with the locations of all necessary binaries.
$_users array Hash caching the parsed users file.

Méthodes publiques

Méthode Description
__construct ( $params = [] ) Constructor.
abbrev ( string $rev ) : string Returns an abbreviated form of the revision, for display.
annotate ( $fileob, $rev ) TODO
assertValidRevision ( mixed $rev ) Throw an exception if the revision number isn't valid.
availableDiffTypes ( ) : array Return the list of available diff types.
checkout ( string $fullname, string $rev ) : resource Function which returns a file pointing to the head of the requested revision of a file.
cmp ( string $rev1, string $rev2 ) : integer Given two revisions, this figures out which one is greater than the the other.
diff ( Horde_Vcs_File_Base $file, string $rev1, string $rev2, array $opts = [] ) : string Obtain the differences between two revisions of a file.
getDefaultBranch ( )
getDirectory ( string $where, array $opts = [] ) : Horde_Vcs_Directory_Base Returns a directory object.
getFile ( $filename, $opts = [] ) TODO
getPatchset ( array $opts = [] ) : Horde_Vcs_Patchset TODO
getPath ( string $binary ) : boolean | string Returns the location of the specified binary.
getRevisionRange ( Horde_Vcs_File_Base $file, string $r1, string $r2 ) : array Create a range of revisions between two revision numbers.
getUsers ( $usersfile ) : array Parse the users file, if present in the sourceroot, and return a hash containing the requisite information, keyed on the username, and with the 'desc', 'name', and 'mail' values inside.
hasFeature ( $feature ) : boolean Does this driver support the given feature?
isFile ( $where ) TODO
isValidRevision ( mixed $rev ) : boolean Validation function to ensure that a revision string is of the right form.
popen ( string $cmd, string $mode = 'r' ) : resource Wrapper around popen() for locale-safe results.

Méthodes protégées

Méthode Description
_diff ( Horde_Vcs_File_Base $file, string $rev1, string $rev2, array $opts ) : string | boolean Obtain the differences between two revisions of a file.
_humanReadableDiff ( array $raw ) : array Obtain a tree containing information about the changes between two revisions.

Method Details

__construct() public méthode

Constructor.
public __construct ( $params = [] )

_diff() protected méthode

Obtain the differences between two revisions of a file.
protected _diff ( Horde_Vcs_File_Base $file, string $rev1, string $rev2, array $opts ) : string | boolean
$file Horde_Vcs_File_Base The desired file.
$rev1 string Original revision number to compare from.
$rev2 string New revision number to compare against.
$opts array The following optional options: - 'num': (integer) DEFAULT: 3 - 'type': (string) DEFAULT: 'unified' - 'ws': (boolean) DEFAULT: true
Résultat string | boolean False on failure, or a string containing the diff on success.

_humanReadableDiff() protected méthode

Obtain a tree containing information about the changes between two revisions.
protected _humanReadableDiff ( array $raw ) : array
$raw array An array of lines of the raw unified diff, normally obtained through Horde_Vcs_Diff::get().
Résultat array @TODO

abbrev() public méthode

Returns an abbreviated form of the revision, for display.
public abbrev ( string $rev ) : string
$rev string The revision string.
Résultat string The abbreviated string.

annotate() public méthode

TODO
public annotate ( $fileob, $rev )

assertValidRevision() public méthode

Throw an exception if the revision number isn't valid.
public assertValidRevision ( mixed $rev )
$rev mixed The revision number.

availableDiffTypes() public méthode

Return the list of available diff types.
public availableDiffTypes ( ) : array
Résultat array The list of available diff types for use with get().

checkout() public méthode

Function which returns a file pointing to the head of the requested revision of a file.
public checkout ( string $fullname, string $rev ) : resource
$fullname string Fully qualified pathname of the desired file to checkout.
$rev string Revision number to check out.
Résultat resource A stream pointer to the head of the checkout.

cmp() public méthode

Given two revisions, this figures out which one is greater than the the other.
public cmp ( string $rev1, string $rev2 ) : integer
$rev1 string Revision string.
$rev2 string Second revision string.
Résultat integer 1 if the first is greater, -1 if the second if greater, and 0 if they are equal

diff() public méthode

Obtain the differences between two revisions of a file.
public diff ( Horde_Vcs_File_Base $file, string $rev1, string $rev2, array $opts = [] ) : string
$file Horde_Vcs_File_Base The desired file.
$rev1 string Original revision number to compare from.
$rev2 string New revision number to compare against.
$opts array The following optional options: - 'human': (boolean) DEFAULT: false - 'num': (integer) DEFAULT: 3 - 'type': (string) DEFAULT: 'unified' - 'ws': (boolean) DEFAULT: true
Résultat string The diff string.

getDefaultBranch() public méthode

public getDefaultBranch ( )

getDirectory() public méthode

Returns a directory object.
public getDirectory ( string $where, array $opts = [] ) : Horde_Vcs_Directory_Base
$where string Path to the directory.
$opts array Any additional options (depends on driver): - 'showattic': (boolean) Parse any Attic/ sub-directory contents too. - 'rev': (string) Generate directory list for a certain branch or revision.
Résultat Horde_Vcs_Directory_Base A directory object.

getFile() public méthode

$opts: 'branch' - (string)
public getFile ( $filename, $opts = [] )

getPatchset() public méthode

TODO
public getPatchset ( array $opts = [] ) : Horde_Vcs_Patchset
$opts array Options: - 'file': (string) The filename to process. REQUIRED for this driver. - 'range': (array) The patchsets to process. DEFAULT: None (all patchsets are processed). - 'timezone': (string) The current timezone.
Résultat Horde_Vcs_Patchset Patchset object.

getPath() public méthode

Returns the location of the specified binary.
public getPath ( string $binary ) : boolean | string
$binary string An external program name.
Résultat boolean | string The location of the external program or false if it wasn't specified.

getRevisionRange() public méthode

Create a range of revisions between two revision numbers.
public getRevisionRange ( Horde_Vcs_File_Base $file, string $r1, string $r2 ) : array
$file Horde_Vcs_File_Base The desired file.
$r1 string The initial revision.
$r2 string The ending revision.
Résultat array The revision range, or empty if there is no straight line path between the revisions.

getUsers() public méthode

Parse the users file, if present in the sourceroot, and return a hash containing the requisite information, keyed on the username, and with the 'desc', 'name', and 'mail' values inside.
public getUsers ( $usersfile ) : array
Résultat array User data.

hasFeature() public méthode

Does this driver support the given feature?
public hasFeature ( $feature ) : boolean
Résultat boolean True if driver supports the given feature.

isFile() public méthode

TODO
public isFile ( $where )

isValidRevision() abstract public méthode

Validation function to ensure that a revision string is of the right form.
abstract public isValidRevision ( mixed $rev ) : boolean
$rev mixed The purported revision string.
Résultat boolean True if a valid revision string.

popen() public méthode

Wrapper around popen() for locale-safe results.
public popen ( string $cmd, string $mode = 'r' ) : resource
$cmd string Command to call.
$mode string popen() mode.
Résultat resource Pipe handle.

Property Details

$_cache protected_oe property

If caching is desired, a Horde_Cache object.
protected Horde_Cache $_cache
Résultat Horde_Cache

$_cacheVersion protected_oe property

Current cache version.
protected int $_cacheVersion
Résultat integer

$_diffTypes protected_oe property

The available diff types.
protected array $_diffTypes
Résultat array

$_driver protected_oe property

The current driver.
protected string $_driver
Résultat string

$_features protected_oe property

Driver features.
protected array $_features
Résultat array

$_paths protected_oe property

Hash with the locations of all necessary binaries.
protected array $_paths
Résultat array

$_users protected_oe property

Hash caching the parsed users file.
protected array $_users
Résultat array

$sourceroot public_oe property

The source root of the repository.
public string $sourceroot
Résultat string