webcreate/vcs
PHP interface for version control systems
Maintainers
Requires
- symfony/filesystem: >=v2.1.2 <3.0|~3.0|~4.0
- symfony/finder: >=v2.1.2 <3.0|~3.0|~4.0
- symfony/process: ~2.3|~3.0|~4.0
- webcreate/util: 1.*
Requires (Dev)
- phpunit/phpunit: ^4.0
Suggests
- symfony/event-dispatcher: Allows to hook into VCS with events
Provides
None
Conflicts
None
Replaces
None
MIT b33857322bdcaa3d7572f0fd1329d4aaf2680cb0
- Jeroen Fiege <jeroen.woop@webcreate.nl>
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.
Installation / Usage
-
Download the
composer.pharexecutable or use the installer.$ curl -s https://getcomposer.org/installer | php -
Create a composer.json defining your dependencies.
{ "require": { "webcreate/vcs": "dev-master" } } -
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/.
