Skip to content

Commit

Permalink
Merge branch 'release/v1.0.11'
Browse files Browse the repository at this point in the history
  • Loading branch information
Matteo Giachino committed Apr 2, 2015
2 parents 9244f12 + 20316e6 commit 1abec5e
Show file tree
Hide file tree
Showing 80 changed files with 2,059 additions and 695 deletions.
13 changes: 5 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ php:
- 5.3
- 5.4
- 5.5
# - hhvm
- 5.6
- hhvm

#matrix:
# allow_failures:
# - hhvm
matrix:
allow_failures:
- hhvm

branches:
only:
Expand All @@ -24,9 +25,5 @@ before_script:
- git --version

script:
#- vendor/bin/phpunit --coverage-clover "clover"
- vendor/bin/phpunit

#after_success:
# - curl -sL https://bit.ly/artifact-uploader | php

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,4 @@ If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
Library.
21 changes: 8 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ How to use
----------

``` php
<?php

use GitElephant\Repository;
$repo = new Repository('/path/to/git/repository');
// or the factory method
Expand Down Expand Up @@ -174,7 +172,6 @@ You could also use GitElephant to manage your git repositories via PHP.
Your web server user (like www-data) needs to have access to the folder of the git repository

``` php
<?php
$repo->init(); // init
$repo->cloneFrom("git://github.com/matteosister/GitElephant.git"); // clone

Expand Down Expand Up @@ -213,8 +210,6 @@ $repo->createTag($repo->getCommit());
If you need to access remote repository you have to install the [ssh2 extension](http://www.php.net/manual/en/book.ssh2.php) and pass a new *Caller* to the repository. *this is a new feature...consider this in a testing phase*

``` php
<?php

$repo = new Repository('/path/to/git/repository');
$connection = ssh_connect('host', 'port');
// authorize the connection with the method you want
Expand All @@ -233,7 +228,6 @@ a tree representation of the repository, at a given point in history.
**Tree class**

``` php
<?php
$tree = $repo->getTree(); // retrieve the actual *HEAD* tree
$tree = $repo->getTree($repo->getCommit('1ac370d')); // retrieve a tree for a given commit
$tree = $repo->getTree('master', 'lib/vendor'); // retrieve a tree for a given path
Expand All @@ -246,7 +240,6 @@ The Tree class implements *ArrayAccess*, *Countable* and *Iterator* interfaces.
You can use it as an array of git objects.

``` php
<?php
foreach ($tree as $treeObject) {
echo $treeObject;
}
Expand All @@ -255,7 +248,6 @@ foreach ($tree as $treeObject) {
A Object instance is a php representation of a node in a git tree

``` php
<?php
echo $treeObject; // the name of the object (folder, file or link)
$treeObject->getType(); // one class constant of Object::TYPE_BLOB, Object::TYPE_TREE and Object::TYPE_LINK
$treeObject->getSha();
Expand All @@ -268,7 +260,6 @@ $treeObject->getPath();
You can also pass a tree object to the repository to get its subtree

``` php
<?php
$subtree = $repo->getTree('master', $treeObject);
```

Expand All @@ -278,7 +269,6 @@ Diffs
If you want to check a Diff between two commits the Diff class comes in

``` php
<?php
// get the diff between the given commit and it parent
$diff = $repo->getDiff($repo->getCommit());
// get the diff between two commits
Expand All @@ -300,7 +290,6 @@ The Diff class implements *ArrayAccess*, *Countable* and *Iterator* interfaces
You can iterate over DiffObject

``` php
<?php
foreach ($diff as $diffObject) {
// mode is a constant of the DiffObject class
// DiffObject::MODE_INDEX an index change
Expand All @@ -323,7 +312,6 @@ Every DiffObject can have multiple chunks of changes. For example:
You can iterate over DiffObject to get DiffChunks. DiffChunks are the last steps of the Diff process, they are a collection of DiffChunkLine Objects

``` php
<?php
foreach ($diffObject as $diffChunk) {
if (count($diffChunk) > 0) {
echo "change detected from line ".$diffChunk->getDestStartLine()." to ".$diffChunk->getDestEndLine();
Expand Down Expand Up @@ -378,10 +366,17 @@ Want to contribute?

Just remember:

* Symfony2 coding standard
* PSR2 coding standard
* test everything you develop with phpunit
* if you don't use gitflow, just remember to branch from "develop" and send your PR there. **Please do not send pull requests on the master branch**.

Author
------

Matteo Giachino ([twitter](https://twitter.com/spicy_sake))

Many thanks to all the [contributors](https://github.com/matteosister/GitElephant/graphs/contributors)

Thanks
------

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"phpcollection/phpcollection": "~0.4"
},
"require-dev": {
"phpunit/phpunit": "4.1.*",
"phpunit/phpunit": "~4.2",
"mockery/mockery": "0.9.*",
"sami/sami": "dev-master"
},
Expand Down
Loading

0 comments on commit 1abec5e

Please sign in to comment.