PHP Класс 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.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$sourceroot string The source root of the repository.

Защищенные свойства (Protected)

Свойство Тип Описание
$_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.

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
_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.

Описание методов

__construct() публичный Метод

Constructor.
public __construct ( $params = [] )

_diff() защищенный Метод

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
Результат string | boolean False on failure, or a string containing the diff on success.

_humanReadableDiff() защищенный Метод

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().
Результат array @TODO

abbrev() публичный Метод

Returns an abbreviated form of the revision, for display.
public abbrev ( string $rev ) : string
$rev string The revision string.
Результат string The abbreviated string.

annotate() публичный Метод

TODO
public annotate ( $fileob, $rev )

assertValidRevision() публичный Метод

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

availableDiffTypes() публичный Метод

Return the list of available diff types.
public availableDiffTypes ( ) : array
Результат array The list of available diff types for use with get().

checkout() публичный Метод

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.
Результат resource A stream pointer to the head of the checkout.

cmp() публичный Метод

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.
Результат integer 1 if the first is greater, -1 if the second if greater, and 0 if they are equal

diff() публичный Метод

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
Результат string The diff string.

getDefaultBranch() публичный Метод

public getDefaultBranch ( )

getDirectory() публичный Метод

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.
Результат Horde_Vcs_Directory_Base A directory object.

getFile() публичный Метод

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

getPatchset() публичный Метод

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.
Результат Horde_Vcs_Patchset Patchset object.

getPath() публичный Метод

Returns the location of the specified binary.
public getPath ( string $binary ) : boolean | string
$binary string An external program name.
Результат boolean | string The location of the external program or false if it wasn't specified.

getRevisionRange() публичный Метод

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.
Результат array The revision range, or empty if there is no straight line path between the revisions.

getUsers() публичный Метод

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
Результат array User data.

hasFeature() публичный Метод

Does this driver support the given feature?
public hasFeature ( $feature ) : boolean
Результат boolean True if driver supports the given feature.

isFile() публичный Метод

TODO
public isFile ( $where )

isValidRevision() абстрактный публичный Метод

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.
Результат boolean True if a valid revision string.

popen() публичный Метод

Wrapper around popen() for locale-safe results.
public popen ( string $cmd, string $mode = 'r' ) : resource
$cmd string Command to call.
$mode string popen() mode.
Результат resource Pipe handle.

Описание свойств

$_cache защищенное свойство

If caching is desired, a Horde_Cache object.
protected Horde_Cache $_cache
Результат Horde_Cache

$_cacheVersion защищенное свойство

Current cache version.
protected int $_cacheVersion
Результат integer

$_diffTypes защищенное свойство

The available diff types.
protected array $_diffTypes
Результат array

$_driver защищенное свойство

The current driver.
protected string $_driver
Результат string

$_features защищенное свойство

Driver features.
protected array $_features
Результат array

$_paths защищенное свойство

Hash with the locations of all necessary binaries.
protected array $_paths
Результат array

$_users защищенное свойство

Hash caching the parsed users file.
protected array $_users
Результат array

$sourceroot публичное свойство

The source root of the repository.
public string $sourceroot
Результат string