GitTree Class Reference

Inheritance diagram for GitTree:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 __construct ($repo)
 _unserialize ($data)
 _serialize ()
 find ($path)
 Find the tree or blob at a certain path.
 listRecursive ()
 Recursively list the contents of a tree.
 updateNode ($path, $mode, $object)
 Updates a node in this tree.

Static Public Member Functions

static treeDiff ($a_tree, $b_tree)

Public Attributes

 $nodes = array()
const TREEDIFF_A = 0x01
const TREEDIFF_B = 0x02
const TREEDIFF_REMOVED = self::TREEDIFF_A
const TREEDIFF_ADDED = self::TREEDIFF_B
const TREEDIFF_CHANGED = 0x03

Static Protected Member Functions

static nodecmp (&$a, &$b)


Detailed Description

Definition at line 26 of file git_tree.class.php.


Constructor & Destructor Documentation

GitTree::__construct ( repo  ) 

Definition at line 30 of file git_tree.class.php.


Member Function Documentation

GitTree::_serialize (  ) 

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

GitTree::_unserialize ( data  ) 

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

GitTree::find ( path  ) 

Find the tree or blob at a certain path.

Exceptions:
GitTreeInvalidPathError The path was found to be invalid. This can happen if you are trying to treat a file like a directory (i.e. foo/bar where foo is a file).
Parameters:
$path (string) The path to look for, relative to this tree.
Returns:
The GitTree or GitBlob at the specified path, or NULL if none could be found.

Definition at line 81 of file git_tree.class.php.

GitTree::listRecursive (  ) 

Recursively list the contents of a tree.

Returns:
(array mapping string to string) An array where the keys are paths relative to the current tree, and the values are SHA-1 names of the corresponding blobs in binary representation.

Definition at line 117 of file git_tree.class.php.

static GitTree::nodecmp ( &$  a,
&$  b 
) [static, protected]

Definition at line 55 of file git_tree.class.php.

static GitTree::treeDiff ( a_tree,
b_tree 
) [static]

Definition at line 213 of file git_tree.class.php.

GitTree::updateNode ( path,
mode,
object 
)

Updates a node in this tree.

Missing directories in the path will be created automatically.

Parameters:
$path (string) Path to the node, relative to this tree.
$mode Git mode to set the node to. 0 if the node shall be cleared, i.e. the tree or blob shall be removed from this path.
$object (string) Binary SHA-1 hash of the object that shall be placed at the given path.
Returns:
(array of GitObject) An array of GitObjects that were newly created while updating the specified node. Those need to be written to the repository together with the modified tree.

Definition at line 151 of file git_tree.class.php.


Member Data Documentation

GitTree::$nodes = array()

Definition at line 28 of file git_tree.class.php.

const GitTree::TREEDIFF_A = 0x01

Definition at line 206 of file git_tree.class.php.

const GitTree::TREEDIFF_ADDED = self::TREEDIFF_B

Definition at line 210 of file git_tree.class.php.

const GitTree::TREEDIFF_B = 0x02

Definition at line 207 of file git_tree.class.php.

Definition at line 211 of file git_tree.class.php.

const GitTree::TREEDIFF_REMOVED = self::TREEDIFF_A

Definition at line 209 of file git_tree.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