Coder Social home page Coder Social logo

sbuzonas / gitter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from klaussilveira/gitter

0.0 3.0 0.0 127 KB

Gitter allows you to interact in an object oriented manner with Git repositories.

License: BSD 3-Clause "New" or "Revised" License

PHP 100.00%

gitter's Introduction

Gitter

Build Status

Gitter allows you to interact in an object oriented manner with Git repositories via PHP. The main goal of the library is not to replace the system git command, but provide a coherent, stable and performatic object oriented interface.

Most commands are sent to the system's git command, parsed and then interpreted by Gitter. Everything is transparent to you, so you don't have to worry about a thing.

Requirements

Authors and contributors

License

New BSD license

Usage

Gitter is very easy to use and you'll just need a few method calls to get started. For example, to create a new repository:

$client = new Gitter\Client;
$repository = $client->createRepository('/home/user/test');

Or a bare repository:

$client = new Gitter\Client;
$repository = $client->createRepository('/home/user/test', true);

Or to open an existing repository:

$client = new Gitter\Client;
$repository = $client->getRepository('/home/user/anothertest');

Both methods will return a Repository object, which has various methods that allow you to interact with that repository.

Getting a list of commits

Once you get hold of the Repository object, you can use:

$commits = $repository->getCommits();
print_r($commits);

To get a list of various commits.

Getting a single commit

Given a specific commit hash, you can find information about that commit:

$commit = $repository->getCommit('920be98a05');
print_r($commit);

Getting statistics for repository

Statistics aggregators can be added to the repository:

$repository->addStatistics(array(
    new Gitter\Statistics\Contributors,
    new Gitter\Statistics\Date,
    new Gitter\Statistics\Day,
    new Gitter\Statistics\Hour
));
print_r($repository->getStatistics());

gitter's People

Contributors

klaussilveira avatar modess avatar gromnan avatar bmanolov avatar cschorn avatar fabpot avatar nateeag avatar cbourgois avatar keradus avatar imdevin567 avatar h4cc avatar tribis avatar siwinski avatar spantaleev avatar tobya avatar tomzx avatar

Watchers

James Cloos avatar Steve Buzonas avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.