Skip to content

Commit

Permalink
Merge 875cac7 into 708715f
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-gribanov committed Aug 14, 2019
2 parents 708715f + 875cac7 commit f988d59
Showing 1 changed file with 1 addition and 82 deletions.
83 changes: 1 addition & 82 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,7 @@ Bundle for use [maxmind/GeoIP2](https://github.com/maxmind/GeoIP2-php) in Symfon
Pretty simple with [Composer](http://packagist.org), run:

```sh
composer require gpslab/geoip2
```

Add GpsLabGeoIP2Bundle to your application kernel

**Symfony <3.4**

```php
// app/AppKernel.php
public function registerBundles()
{
return array(
// ...
new GpsLab\Bundle\GeoIP2Bundle\GpsLabGeoIP2Bundle(),
);
}
```

**Symfony >4.0**

```php
// config/bundles.php
return [
// ...
GpsLab\Bundle\GeoIP2Bundle\GpsLabGeoIP2Bundle::class => ['all' => true],
];
composer req gpslab/geoip2
```

## Configuration
Expand Down Expand Up @@ -90,68 +65,12 @@ For more example see the [GeoIP2](https://github.com/maxmind/GeoIP2-php) library

## Update GeoIP database

### From command line

Execute command for update database:

**Symfony <2.8**

```
php app/console geoip2:update
```

**Symfony >3.0**

```
php bin/console geoip2:update
```

### From composer

Add to your `composer.json` event callbacks in a `scripts` section:


**Symfony <3.0**

```json
{
"scripts": {
"post-install-cmd": [
"GpsLab\\Bundle\\GeoIP2Bundle\\Composer\\ScriptHandler::updateDatabase"
],
"post-update-cmd": [
"GpsLab\\Bundle\\GeoIP2Bundle\\Composer\\ScriptHandler::updateDatabase"
]
}
}
```

**Symfony >3.1**

```json
{
"scripts": {
"symfony-scripts": [
"GpsLab\\Bundle\\GeoIP2Bundle\\Composer\\ScriptHandler::updateDatabase"
]
}
}
```

**Symfony >4 Flex**

Add the command "geoip2:update": "symfony-cmd" to your autoscripts

```json
{
"scripts": {
"auto-scripts": {
"geoip2:update": "symfony-cmd"
},
}
}
```

## License

This bundle is under the [MIT license](http://opensource.org/licenses/MIT). See the complete license in the file: LICENSE

0 comments on commit f988d59

Please sign in to comment.