PHP interface for version control systems
Latest commit bcf0ea7 Jun 20, 2016 @fieg fieg committed on GitHub Merge pull request #9 from FabienM/update-symfony
Allow Symfony 3 components
Failed to load latest commit information.
docs Commit by Conveyor Mar 18, 2013
tests fix svadminTest for windows for the last part of #2 Oct 31, 2013
.gitignore Commit by Conveyor Feb 19, 2013
LICENSE Refactored the Pointer and FileInfo class Feb 8, 2013 Commit by Conveyor Mar 5, 2013
composer.json Allow Symfony 3 components Jun 18, 2016
phpunit.xml.dist Initial version of Webcreate\Vcs Nov 29, 2012

PHP interface for version control systems

Webcreate\Vcs is an interface for PHP for working with various version control systems, like SVN, GIT, etc.

This library was created as part of Conveyor.

Build Status

Installation / Usage

  1. Download the composer.phar executable or use the installer.

    $ curl -s | php
  2. Create a composer.json defining your dependencies.

        "require": {
            "webcreate/vcs": "dev-master"
  3. Run Composer: php composer.phar install

Getting started

Webcreate\Vcs is build around a single interface, the VcsInterface. This interface contains methods to work with a version control system.

This libary currently contains two implementations of the interface: Svn and Git.

Lets say you want to get the latest commits from git. Here is an example:

// Example R1
use Webcreate\Vcs\Git;

$git = new Git('https://someserver/somerepo.git');

// Retrieve the 20 latest commits for master
$result = $git->log('.', null, 20);
foreach($result as $commit) {
    $date        = $commit->getDate();      // returns \DateTime instance
    $author      = $commit->getAuthor();    // returns "John Doe"
    $revision    = $commit->getRevision();  // returns "1a410efbd13591db07496601ebc7a059dd55cfe9"
    $message     = $commit->getMessage();   // returns "commit message"

Full documentation is available in docs/.