Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #12 from niels-nijens/readme-usage
Browse files Browse the repository at this point in the history
Improved usage in README
  • Loading branch information
niels-nijens committed Nov 22, 2015
2 parents f33ab0d + 49808f2 commit 399e734
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,21 @@ $ composer require accompli/chrono
```

## Usage
The `Repository` class will detect which registered VCS adapter to use based on the URL of the repository.

```php
<?php

use Accompli\Chrono\Process\ProcessExecutor;
use Accompli\Chrono\Repository;

$repository = new Repository('https://github.com/accompli/chrono.git');
$repository->checkout();
$repository = new Repository('https://github.com/accompli/chrono.git', '/vcs/checkout/directory', new ProcessExecutor());

$repository->getBranches(); // Returns an array with all available branches in the repository.

$repository->getTags(); // Returns an array with all available tags in the repository.

$repository->checkout('0.1.0'); // Creates or updates a checkout of a tag or branch in the repository directory.

```

Expand All @@ -35,6 +43,7 @@ Chrono uses [Semantic Versioning 2][link-semver] for new versions.

- [Niels Nijens][link-author]
- [All Contributors][link-contributors]
- Inspired by the VCS drivers of Composer.

## License

Expand Down

0 comments on commit 399e734

Please sign in to comment.