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.
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$sourceroot string The source root of the repository.

보호된 프로퍼티들

프로퍼티 타입 설명
$_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