Simplify Composer instructions

This commit is contained in:
Gregory Oschwald 2014-07-14 12:22:43 -07:00
parent adffe69dd2
commit e441dbb64e
2 changed files with 17 additions and 21 deletions

View File

@ -9,40 +9,36 @@ the free [GeoLite2 databases](http://dev.maxmind.com/geoip/geoip2/geolite2/).
## Install via Composer ## ## Install via Composer ##
### Define Your Dependencies ###
We recommend installing this package with [Composer](http://getcomposer.org/). We recommend installing this package with [Composer](http://getcomposer.org/).
To do this, add `geoip2/geoip2` to your `composer.json` file. If you don't
have a `composer.json` file, create one in the root directory of your project.
```json ### Downloading Composer ###
{
"require": { To download Composer, run in the root directory of your project:
"geoip2/geoip2": "0.6.*"
} ```bash
} curl -sS https://getcomposer.org/installer | php
``` ```
### Install Composer ### You should now have the file `composer.phar` in your project directory.
Run in your project root:
```
curl -s http://getcomposer.org/installer | php
```
### Install Dependencies ### ### Install Dependencies ###
Run in your project root: Run in your project root:
``` ```
php composer.phar install php composer.phar require geoip2/geoip2:~0.6.3
``` ```
You should now have the files `composer.json` and `composer.lock` as well as
the directory `vendor` in your project directory. If you use a version control
system, `composer.json` should be added to it.
### Require Autoloader ### ### Require Autoloader ###
You can autoload all dependencies by adding this to your code: After installing the dependencies, you need to require the Composer autoloader
``` from your code:
```php
require 'vendor/autoload.php'; require 'vendor/autoload.php';
``` ```

@ -1 +1 @@
Subproject commit f53865477d361101969853f8d418458fd58cdc74 Subproject commit c57c2ccf4a0c7b000cd6cd9a4a4463e7b54d7d2c