From e5591fa56f1c231a439fe185b9b2d697eadd1dce Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Sat, 5 May 2012 21:31:08 +0200 Subject: [PATCH] Add more classes to php-libgit --- public_html/libgit/base.php | 3 ++ public_html/libgit/class.blob.php | 8 ++++ public_html/libgit/class.tag.php | 8 ++++ public_html/libgit/class.tree.element.php | 14 +++++++ public_html/libgit/class.tree.php | 47 +++++++++++++++++++++- public_html/test.hex | Bin 0 -> 152 bytes public_html/test.php | 5 ++- 7 files changed, 82 insertions(+), 3 deletions(-) create mode 100644 public_html/libgit/class.blob.php create mode 100644 public_html/libgit/class.tag.php create mode 100644 public_html/libgit/class.tree.element.php create mode 100644 public_html/test.hex diff --git a/public_html/libgit/base.php b/public_html/libgit/base.php index bd9f7bc..038d49c 100644 --- a/public_html/libgit/base.php +++ b/public_html/libgit/base.php @@ -25,7 +25,10 @@ function sha1_from_bin($bin) require(dirname(__FILE__) . "/class.repository.php"); require(dirname(__FILE__) . "/class.object.php"); +require(dirname(__FILE__) . "/class.blob.php"); +require(dirname(__FILE__) . "/class.tag.php"); require(dirname(__FILE__) . "/class.tree.php"); +require(dirname(__FILE__) . "/class.tree.element.php"); require(dirname(__FILE__) . "/class.commit.php"); require(dirname(__FILE__) . "/class.actor.php"); ?> diff --git a/public_html/libgit/class.blob.php b/public_html/libgit/class.blob.php new file mode 100644 index 0000000..37cc44a --- /dev/null +++ b/public_html/libgit/class.blob.php @@ -0,0 +1,8 @@ +mode = $mode; + $this->filename = $filename; + $this->hash = $hash; + } +} diff --git a/public_html/libgit/class.tree.php b/public_html/libgit/class.tree.php index de6703f..3f42d4c 100644 --- a/public_html/libgit/class.tree.php +++ b/public_html/libgit/class.tree.php @@ -1,5 +1,50 @@ elements[] = new GitTreeElement($mode, $filename, $hash); + } + } } diff --git a/public_html/test.hex b/public_html/test.hex new file mode 100644 index 0000000000000000000000000000000000000000..c0f95ee1f52ed17ab3901773e156a70553ba4a08 GIT binary patch literal 152 zcmXRZN=;QTG%;o{G%zqTF;UP<&n(GI&&w}LWvH8QUZB-!l3u6Up*tZSdCC{w6c|BO z`FJ|J`USf(++JvR>F)RDca0LqmNwr09?befY_W*}5GWLsCgo%%$7ht}<}j$uo4fAi x?FAM&hou9RG%csKa)j_eRF&lC=M*!9{>f`Jsto6 literal 0 HcmV?d00001 diff --git a/public_html/test.php b/public_html/test.php index 19d2026..b6fc4cb 100644 --- a/public_html/test.php +++ b/public_html/test.php @@ -2,7 +2,8 @@ require("libgit/base.php"); $s = new GitRepository("/home/occupy/testrepo.git"); -pretty_dump($s->GetObject("54e03e490b1bee1c154c3545bf258cab0629ee02")); +/*pretty_dump($s->GetObject("54e03e490b1bee1c154c3545bf258cab0629ee02")); pretty_dump($s->GetObject("98d99489382a3541e6783bb2083554785f3eb72a")); pretty_dump($s->GetObject("9d8e0ba4a30f6a5d775a879c42c7de5aed4530c6")); -pretty_dump($s->GetObject("710bfee4440517255475bf7c5454c0bdbb3b3e56")); +pretty_dump($s->GetObject("710bfee4440517255475bf7c5454c0bdbb3b3e56"));*/ +pretty_dump($s->GetObject("dba13ed2ddf783ee8118c6a581dbf75305f816a3"));