Skip to content

Commit 839c338

Browse files
committed
Add documentation for the manual installation method to the README.
1 parent edaf7e2 commit 839c338

File tree

1 file changed

+48
-3
lines changed

1 file changed

+48
-3
lines changed

README.markdown

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,65 @@ A possible solution to this would be to create an extra APIs implementing the mi
5555

5656
## Install
5757

58-
Through [composer](http://getcomposer.org/download/), simply run :
58+
### Composer
59+
60+
[Composer](http://getcomposer.org/download/) users can simply run:
5961

6062
```bash
6163
$ php composer.phar require kbsali/redmine-api:~1.0
6264
```
6365

66+
at the root of their projects. To utilize the library, include
67+
Composer's `vendor/autoload.php` in the scripts that will use the
68+
`Redmine` classes.
69+
70+
For example,
71+
72+
```php
73+
<?php
74+
// This file is generated by Composer
75+
require_once 'vendor/autoload.php';
76+
$client = new Redmine\Client('http://redmine.example.com', 'username', 'password');
77+
```
78+
79+
### Manual
80+
81+
It is also possible to install the library oneself, either locally to
82+
a project or globally; say, in `/usr/share/php`.
83+
84+
First, download and extract the library somewhere. For example, the
85+
following steps extract v1.5.1 of the library into the
86+
`vendor/php-redmine-api-1.5.1` directory:
87+
88+
```bash
89+
$ mkdir vendor
90+
$ wget -q https://github.com/kbsali/php-redmine-api/archive/v1.5.1.tar.gz
91+
$ tar -xf v1.5.1.tar.gz -C vendor/
92+
$ rm v1.5.1.tar.gz
93+
```
94+
95+
Now, in any scripts that will use the `Redmine` classes, include the
96+
`lib/autoload.php` file from the php-redmine-api directory. For
97+
example,
98+
99+
```php
100+
<?php
101+
// This file ships with php-redmine-api
102+
require 'vendor/php-redmine-api-1.5.1/lib/autoload.php';
103+
$client = new Redmine\Client('http://redmine.example.com', 'username', 'password');
104+
```
105+
64106
## Basic usage of `php-redmine-api` client
65107

66108
```php
67109
<?php
68110

69-
// This file is generated by Composer
111+
// For Composer users (this file is generated by Composer)
70112
require_once 'vendor/autoload.php';
71113

114+
// Or if you've installed the library manually, use this instead.
115+
// require 'vendor/php-redmine-api-x.y.z/lib/autoload.php';
116+
72117
$client = new Redmine\Client('http://redmine.example.com', 'API_ACCESS_KEY');
73118
//-- OR --
74119
$client = new Redmine\Client('http://redmine.example.com', 'username', 'password');
@@ -87,7 +132,7 @@ $client->api('issue')->all([
87132
]);
88133
```
89134

90-
see `example.php`
135+
See `example.php` for further examples.
91136

92137
## User Impersonation
93138

0 commit comments

Comments
 (0)