GitClient

Class
implements GitClientInterface
Read only: Yes Final: Yes

Executes semantic Git operations using the local Git binary.

Table of Contents

Interfaces

GitClientInterface

Provides semantic Git operations for repository-aware services.

Properties

Methods

 : mixed
getConfig()

Returns a Git config value for the selected repository.

 : string
show()

Returns the file contents shown from a specific Git reference.

 : string
run()

Executes a Git process and returns trimmed stdout.

 : string
Properties
Methods

getConfig()

Public

Returns a Git config value for the selected repository.

public getConfig( string  $key[, string|null  $workingDirectory = null]) : string
Parameters
$key : string
$workingDirectory : string|null = null
Return values
string

show()

Public

Returns the file contents shown from a specific Git reference.

public show( string  $reference, string  $path[, string|null  $workingDirectory = null]) : string
Parameters
$reference : string
$path : string
$workingDirectory : string|null = null
Return values
string

run()

Private

Executes a Git process and returns trimmed stdout.

private run(Process  $process[, string|null  $workingDirectory = null]) : string
Parameters
$process : Process
$workingDirectory : string|null = null
Return values
string