Skip to content

Library containing helpers to provide information about GIT repository like commits, branches and contributors

License

Notifications You must be signed in to change notification settings

Nazariy/git-reader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

git-reader

Library containing helpers to provide information about GIT repository like commits, branches and contributors

##Usage

<?php

use GitReader\Repository;

$repository = new Repository('/path/to/repository');

// List Branches
$branches = $repository->getBranches();

/* Results
Array
(
    [0] => Array
        (
            [hash] => 584ce306cbc017f1d0a0b4d75a9c7cd005780d8c
            [type] => heads
            [path] => refs/heads/master
            [name] => master
        )

    [1] => Array
        (
            [hash] => 584ce306cbc017f1d0a0b4d75a9c7cd005780d8c
            [type] => remotes
            [path] => refs/remotes/origin/HEAD
            [name] => origin/HEAD
        )

    [2] => Array
        (
            [hash] => 584ce306cbc017f1d0a0b4d75a9c7cd005780d8c
            [type] => remotes
            [path] => refs/remotes/origin/master
            [name] => origin/master
        )

)
*/

// Show Contributors
$contributors = $repository->getContributors();
/* Results
Array
(
    [0] => Array
        (
            [name] => Nazariy Slyusarchuk
            [email] => [email protected]
            [commits] => 4
        )

)
*/

// Show Stats
$stats = $repository->getShortStatGraph();
/*
Array
(
    [0] => Array
        (
            [author] => Nazariy Slyusarchuk <[email protected]>
            [author_email] => [email protected]
            [author_name] => Slyusarchuk
            [changes] => Array
                (
                    [0] => Update README.md
                )

            [comment] => Update README.md
            [date] => DateTime Object
                (
                    [date] => 2019-08-06 18:09:49.000000
                    [timezone_type] => 1
                    [timezone] => +03:00
                )

            [hash] => 584ce306cbc017f1d0a0b4d75a9c7cd005780d8c
            [stats] => 1 file changed, 3 insertions(+), 2 deletions(-)
        )
)
*/

About

Library containing helpers to provide information about GIT repository like commits, branches and contributors

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages