VersionControl_Git
[ class tree: VersionControl_Git ] [ index: VersionControl_Git ] [ all elements ]

Class: VersionControl_Git

Source Location: /VersionControl_Git-0.4.4/VersionControl/Git.php

Class Overview


The OO interface for Git


Author(s):

Copyright:

  • 2010 Kousuke Ebihara

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 51]
The OO interface for Git

An instance of this class can be handled as OO interface for a Git repository.



[ Top ]


Class Variables

$directory =

[line 58]

The directory for this repository
  • Access: protected

Type:   string


[ Top ]

$gitCommandPath =  '/usr/bin/git'

[line 65]

Location to git binary
  • Access: protected

Type:   string


[ Top ]



Method Detail

__construct (Constructor)   [line 72]

VersionControl_Git __construct( [string $reposDir = './'])

Constructor
  • Access: public

Parameters:

string   $reposDir   —  A directory path to a git repository

[ Top ]

checkout   [line 283]

null checkout( mixed $object)

Checkout the specified branch

Checking out a path is not supported currently.

  • Access: public

Parameters:

mixed   $object   —  The commit object. It can be string or an instance of the VersionControl_Git_Object

[ Top ]

createClone   [line 136]

null createClone( string $repository, [bool $isBare = false], [string $directory = null])

Create a new clone from the specified repository

It is wrapper of "git clone" command.

  • Access: public

Parameters:

string   $repository   —  The path to repository
bool   $isBare   —  Whether to create bare clone
string   $directory   —  The path to new repository

[ Top ]

getBranches   [line 216]

array getBranches( )

Get an array of branch names
  • Access: public

[ Top ]

getCommand   [line 362]

VersionControl_Git_Util_Command getCommand( string $subCommand)

Get an instance of the VersionControl_Git_Util_Command that is related to this repository
  • Access: public

Parameters:

string   $subCommand   —  A subcommand to execute

[ Top ]

getCommits   [line 115]

VersionControl_Git_Util_RevListFetcher getCommits( [mixed $object = 'master'], [int $maxResults = 100], [int $offset = 0])

Get an array of the VersionControl_Git_Object_Commit objects
  • Access: public

Parameters:

mixed   $object   —  The commit object. It can be string or an instance of the VersionControl_Git_Object
int   $maxResults   —  A number of results
int   $offset   —  A starting position of results

[ Top ]

getCurrentBranch   [line 264]

string getCurrentBranch( )

Get a current branch name
  • Access: public

[ Top ]

getDirectory   [line 375]

string getDirectory( )

Get the directory for this repository
  • Access: public

[ Top ]

getGitCommandPath   [line 385]

string getGitCommandPath( )

Get the location to git binary
  • Access: public

[ Top ]

getGitVersion   [line 87]

string getGitVersion( )

Get Git version (e.g. 1.7.0)
  • Access: public

[ Top ]

getHeadCommits   [line 297]

array getHeadCommits( )

Get an array of branch object names
  • Access: public

[ Top ]

getRemoteBranches   [line 236]

array getRemoteBranches( [string $name = 'origin'])

Get an array of remote branch names
  • Access: public

Parameters:

string   $name   —  The name of remote repository

[ Top ]

getRevListFetcher   [line 100]

VersionControl_Git_Util_RevListFetcher getRevListFetcher( )

Get an instance of the VersionControl_Git_Util_RevListFetcher that is related to this repository
  • Access: public

[ Top ]

getTags   [line 321]

array getTags( )

Get an array of tag names
  • Access: public

[ Top ]

getTree   [line 349]

VersionControl_Git_Object_Tree getTree( mixed $object)

Get an instance of the VersionControl_Git_Object_Tree that is related to this repository
  • Access: public

Parameters:

mixed   $object   —  The commit object. It can be string or an instance of the VersionControl_Git_Object

[ Top ]

initialRepository   [line 206]

null initialRepository( [bool $isBare = false])

Alias of VersionControl_Git::initRepository()

This method is available for backward compatibility.

  • Access: public

Parameters:

bool   $isBare   —  Whether to create bare clone

[ Top ]

initRepository   [line 178]

null initRepository( [bool $isBare = false])

Initialize a new repository

It is wrapper of "git init" command.

  • Access: public

Parameters:

bool   $isBare   —  Whether to create bare clone

[ Top ]

setGitCommandPath   [line 397]

null setGitCommandPath( string $path)

Set the location to git binary
  • Access: public

Parameters:

string   $path   —  The location to git binary

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:43:04 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.