Skip to content

Commit 7173d00

Browse files
authored
Merge pull request #155 from chteuchteu/update-readme
Enhance README.md
2 parents f6f441d + e0fb5a0 commit 7173d00

File tree

1 file changed

+35
-35
lines changed

1 file changed

+35
-35
lines changed

README.md

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
A PHP wrapper for use with the [Gitlab API](https://github.com/gitlabhq/gitlabhq/tree/master/doc/api).
1+
A PHP wrapper to be used with [Gitlab's API](https://github.com/gitlabhq/gitlabhq/tree/master/doc/api).
22
==============
33

44
[![Build Status](https://travis-ci.org/m4tthumphrey/php-gitlab-api.svg?branch=master)](https://travis-ci.org/m4tthumphrey/php-gitlab-api)
@@ -7,36 +7,43 @@ Based on [php-github-api](https://github.com/m4tthumphrey/php-github-api) and co
77

88
Installation
99
------------
10-
Install Composer
10+
1. Install Composer
1111

12-
```
13-
$ curl -sS https://getcomposer.org/installer | php
14-
$ sudo mv composer.phar /usr/local/bin/composer
15-
```
12+
```bash
13+
$ curl -sS https://getcomposer.org/installer | php
14+
$ sudo mv composer.phar /usr/local/bin/composer
15+
```
1616

17-
Add the following to your require block in composer.json config. Note: be careful when using the `dev-master` tag as this may have unexpected results depending on your version of Gitlab. See the Versioning section below for more information.
17+
2. Add the following to your require block in composer.json config.
1818

19-
```
20-
"m4tthumphrey/php-gitlab-api": "dev-master"
21-
```
19+
> Note: be careful when using the `dev-master` tag as this may have unexpected results depending on your version of
20+
Gitlab. See the Versioning section below for more information.
2221

23-
Include Composer's autoloader:
22+
```json
23+
"m4tthumphrey/php-gitlab-api": "dev-master"
24+
```
2425

26+
3. Include Composer's autoloader:
2527
26-
```php
27-
require_once dirname(__DIR__).'/vendor/autoload.php';
28-
```
28+
```php
29+
require_once dirname(__DIR__).'/vendor/autoload.php';
30+
```
2931
3032
Versioning
3133
----------
3234
33-
From the 6.0 stable release of Gitlab, I shall now be matching the client version with the Gitlab version. For example when Gitlab 6.1 is released I will release version 6.1.0 of the API client. If I need to make future updates to the client before the next API version is released. I will simply use a 3th build version. For example `6.1.1`, `6.1.2` etc. It is recommended that you keep your composer file up to date depending on what version of Gitlab you are currently running. So if you are using 6.0, you should required `6.0.*`; 6.1 should be `6.1.*` etc etc.
35+
From the 6.0 stable release of Gitlab, I shall now be matching the client version with the Gitlab version. For example
36+
when Gitlab 6.1 is released I will release version 6.1.0 of the API client. If I need to make future updates to the client
37+
before the next API version is released, I'll simply use a 3rd build version - `6.1.1`, `6.1.2` etc for example.
38+
39+
It is recommended that you keep your composer file in sync with whatever version of Gitlab you are currently running:
40+
if you are using 6.0, you should require `6.0.*`; 6.1 should be `6.1.*`...
3441

3542
General API Usage
3643
-----------------
3744

3845
```php
39-
$client = new \Gitlab\Client('http://git.yourdomain.com/api/v3/'); // change here
46+
$client = new \Gitlab\Client('http://git.yourdomain.com/api/v3/'); // change here
4047
$client->authenticate('your_gitlab_token_here', \Gitlab\Client::AUTH_URL_TOKEN); // change here
4148
4249
$project = $client->api('projects')->create('My Project', array(
@@ -49,50 +56,43 @@ $project = $client->api('projects')->create('My Project', array(
4956
Model Usage
5057
-----------
5158

52-
You can also use the library in an object oriented manner.
59+
You can also use the library in an object oriented manner:
5360

5461
```php
55-
$client = new \Gitlab\Client('http://git.yourdomain.com/api/v3/'); // change here
62+
$client = new \Gitlab\Client('http://git.yourdomain.com/api/v3/'); // change here
5663
$client->authenticate('your_gitlab_token_here', \Gitlab\Client::AUTH_URL_TOKEN); // change here
57-
```
5864
59-
Creating a new project
60-
61-
```php
65+
# Creating a new project
6266
$project = \Gitlab\Model\Project::create($client, 'My Project', array(
6367
'description' => 'This is my project',
6468
'issues_enabled' => false
6569
));
6670
6771
$project->addHook('http://mydomain.com/hook/push/1');
68-
```
69-
70-
Creating a new issue
7172
72-
```php
73+
# Creating a new issue
7374
$project = new \Gitlab\Model\Project(1, $client);
74-
$issue = $project->createIssue('This does not work..', array(
75-
'description' => 'This doesnt work properly. Please fix',
75+
$issue = $project->createIssue('This does not work.', array(
76+
'description' => 'This doesn\'t work properly. Please fix.',
7677
'assignee_id' => 2
7778
));
78-
```
7979
80-
Closing that issue
81-
82-
```php
80+
# Closing that issue
8381
$issue->close();
8482
```
8583
86-
You get the idea! Take a look around and please feel free to report any bugs.
84+
You get the idea! Take a look around ([API methods](https://github.com/m4tthumphrey/php-gitlab-api/tree/master/lib/Gitlab/Api),
85+
[models](https://github.com/m4tthumphrey/php-gitlab-api/tree/master/lib/Gitlab/Model)) and please feel free to report any bugs.
8786
8887
Framework Integrations
8988
----------------------
9089
- **Symfony** - https://github.com/Zeichen32/GitLabApiBundle
9190
- **Laravel** - https://github.com/vinkla/gitlab
9291
93-
If you have integrated GitLab into a popular PHP framework let us know!
92+
If you have integrated GitLab into a popular PHP framework, let us know!
9493
9594
Contributing
9695
------------
9796
98-
There are many parts of Gitlab that I have not added to this as it was originally created for personal use, hence the lack of tests. Feel free to fork and add new functionality and tests, I'll gladly accept decent pull requests.
97+
There are many parts of Gitlab that I have not added to this as it was originally created for personal use, hence the
98+
lack of tests. Feel free to fork and add new functionality and tests, I'll gladly accept decent pull requests.

0 commit comments

Comments
 (0)