Git Class Reference

List of all members.

Public Member Functions

 __construct ($dir)
 getObject ($name)
 Fetch an object in its PHP representation.
 getTip ($branch='master')
 Look up a branch.

Static Public Member Functions

static getTypeID ($name)
static getTypeName ($type)

Public Attributes

 $dir
const OBJ_NONE = 0
const OBJ_COMMIT = 1
const OBJ_TREE = 2
const OBJ_BLOB = 3
const OBJ_TAG = 4
const OBJ_OFS_DELTA = 6
const OBJ_REF_DELTA = 7

Protected Member Functions

 readFanout ($f, $object_name, $offset)
 Tries to find $object_name in the fanout table in $f at $offset.
 findPackedObject ($object_name)
 Try to find an object in a pack.
 applyDelta ($delta, $base)
 Apply the git delta $delta to the byte sequence $base.
 unpackObject ($pack, $object_offset)
 Unpack an object from a pack.
 getRawObject ($object_name)
 Fetch an object in its binary representation by name.

Related Functions

(Note that these are not member functions.)

 sha1_bin ($hex)
 Convert a SHA-1 hash from hexadecimal to binary representation.
 sha1_hex ($bin)
 Convert a SHA-1 hash from binary to hexadecimal representation.


Detailed Description

Definition at line 52 of file git.class.php.


Constructor & Destructor Documentation

Git::__construct ( dir  ) 

Definition at line 90 of file git.class.php.


Member Function Documentation

Git::applyDelta ( delta,
base 
) [protected]

Apply the git delta $delta to the byte sequence $base.

Parameters:
$delta (string) the delta to apply
$base (string) the sequence to patch
Returns:
(string) the patched byte sequence

Definition at line 221 of file git.class.php.

Git::findPackedObject ( object_name  )  [protected]

Try to find an object in a pack.

Parameters:
$object_name (string) name of the object (binary SHA1)
Returns:
(array) an array consisting of the name of the pack (string) and the byte offset inside it, or NULL if not found

Definition at line 132 of file git.class.php.

Git::getObject ( name  ) 

Fetch an object in its PHP representation.

Parameters:
$name (string) name of the object (binary SHA1)
Returns:
(GitObject) the object

Definition at line 390 of file git.class.php.

Git::getRawObject ( object_name  )  [protected]

Fetch an object in its binary representation by name.

Throws an exception if the object cannot be found.

Parameters:
$object_name (string) name of the object (binary SHA1)
Returns:
(array) an array consisting of the object type (int) and the binary representation of the object (string)

Definition at line 345 of file git.class.php.

Git::getTip ( branch = 'master'  ) 

Look up a branch.

Parameters:
$branch (string) The branch to look up, defaulting to master.
Returns:
(string) The tip of the branch (binary sha1).

Definition at line 405 of file git.class.php.

static Git::getTypeID ( name  )  [static]

Definition at line 64 of file git.class.php.

static Git::getTypeName ( type  )  [static]

Definition at line 77 of file git.class.php.

Git::readFanout ( f,
object_name,
offset 
) [protected]

Tries to find $object_name in the fanout table in $f at $offset.

Returns:
array The range where the object can be located (first possible location and past-the-end location)

Definition at line 107 of file git.class.php.

Git::unpackObject ( pack,
object_offset 
) [protected]

Unpack an object from a pack.

Parameters:
$pack (resource) open .pack file
$object_offset (integer) offset of the object in the pack
Returns:
(array) an array consisting of the object type (int) and the binary representation of the object (string)

Definition at line 264 of file git.class.php.


Friends And Related Function Documentation

sha1_bin ( hex  )  [related]

Convert a SHA-1 hash from hexadecimal to binary representation.

Parameters:
$hex (string) The hash in hexadecimal representation.
Returns:
(string) The hash in binary representation.

Definition at line 35 of file git.class.php.

sha1_hex ( bin  )  [related]

Convert a SHA-1 hash from binary to hexadecimal representation.

Parameters:
$bin (string) The hash in binary representation.
Returns:
(string) The hash in hexadecimal representation.

Definition at line 47 of file git.class.php.


Member Data Documentation

Git::$dir

Definition at line 54 of file git.class.php.

const Git::OBJ_BLOB = 3

Definition at line 59 of file git.class.php.

const Git::OBJ_COMMIT = 1

Definition at line 57 of file git.class.php.

const Git::OBJ_NONE = 0

Definition at line 56 of file git.class.php.

const Git::OBJ_OFS_DELTA = 6

Definition at line 61 of file git.class.php.

const Git::OBJ_REF_DELTA = 7

Definition at line 62 of file git.class.php.

const Git::OBJ_TAG = 4

Definition at line 60 of file git.class.php.

const Git::OBJ_TREE = 2

Definition at line 58 of file git.class.php.


The documentation for this class was generated from the following file:

Generated on Sun May 31 19:50:30 2009 for glip by  doxygen 1.5.9