承接 webcreate/vcs 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

webcreate/vcs

最新稳定版本:1.3.0

Composer 安装命令:

composer require webcreate/vcs

包简介

PHP interface for version control systems

README 文档

README

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 https://getcomposer.org/installer | 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/.

统计信息

  • 总下载量: 112.81k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 64
  • 点击次数: 2
  • 依赖项目数: 4
  • 推荐数: 0

GitHub 信息

  • Stars: 59
  • Watchers: 4
  • Forks: 9
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2012-11-30