
Public Member Functions | |
| getName () | |
| Get the object's cached SHA-1 hash value. | |
| getType () | |
| Get the object's type. | |
| __construct ($repo, $type) | |
| Internal constructor for use from derived classes. | |
| unserialize ($data) | |
| Populate this object with values from its string representation. | |
| serialize () | |
| Get the string representation of an object. | |
| rehash () | |
| Update the SHA-1 name of an object. | |
| write () | |
| Write this object in its serialized form to the git repository given at creation time. | |
Static Public Member Functions | |
| static | create ($repo, $type) |
| Create a GitObject of the specified type. | |
Public Attributes | |
| $repo | |
| (Git) The repository this object belongs to. | |
Protected Member Functions | |
| hash ($data) | |
| Internal function to calculate the hash value of a git object of the current type with content $data. | |
Protected Attributes | |
| $type | |
| $name = NULL | |
Definition at line 21 of file git_object.class.php.
| GitObject::__construct | ( | $ | repo, | |
| $ | type | |||
| ) |
Internal constructor for use from derived classes.
Never use this function except from a derived class. Use the constructor of a derived class, create() or Git::getObject() instead.
Definition at line 88 of file git_object.class.php.
| static GitObject::create | ( | $ | repo, | |
| $ | type | |||
| ) | [static] |
Create a GitObject of the specified type.
| $repo | (Git) The repository the object belongs to. | |
| $type | (integer) Object type (one of Git::OBJ_COMMIT, Git::OBJ_TREE, Git::OBJ_BLOB). |
Definition at line 53 of file git_object.class.php.
| GitObject::getName | ( | ) |
Get the object's cached SHA-1 hash value.
Definition at line 35 of file git_object.class.php.
| GitObject::getType | ( | ) |
Get the object's type.
Definition at line 43 of file git_object.class.php.
| GitObject::hash | ( | $ | data | ) | [protected] |
Internal function to calculate the hash value of a git object of the current type with content $data.
| $data | (string) The data to hash. |
Definition at line 71 of file git_object.class.php.
| GitObject::rehash | ( | ) |
Update the SHA-1 name of an object.
You need to call this function after making changes to attributes in order to have getName() return the correct hash.
Definition at line 126 of file git_object.class.php.
| GitObject::serialize | ( | ) |
Get the string representation of an object.
Definition at line 115 of file git_object.class.php.
| GitObject::unserialize | ( | $ | data | ) |
Populate this object with values from its string representation.
Note that the types of $this and the serialized object in $data have to match.
| $data | (string) The serialized representation of an object, as it would be stored by git. |
Definition at line 103 of file git_object.class.php.
| GitObject::write | ( | ) |
Write this object in its serialized form to the git repository given at creation time.
Definition at line 135 of file git_object.class.php.
GitObject::$name = NULL [protected] |
Definition at line 28 of file git_object.class.php.
| GitObject::$repo |
GitObject::$type [protected] |
Definition at line 27 of file git_object.class.php.
1.5.9