-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from ARCANEDEV/develop
Updating the package (v2)
- Loading branch information
Showing
75 changed files
with
2,965 additions
and
64,750 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# This file is for unifying the coding style for different editors and IDEs | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 4 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
.idea/ | ||
_arcanedev/ | ||
build/ | ||
vendor/ | ||
composer.phar | ||
composer.lock | ||
/build/ | ||
/vendor/ | ||
/composer.lock | ||
/composer.phar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,31 @@ | ||
language: php | ||
|
||
sudo: false | ||
|
||
php: | ||
- 5.4 | ||
- 5.5 | ||
- 5.6 | ||
- hhvm | ||
- 7.0 | ||
- 7.1 | ||
- nightly | ||
|
||
matrix: | ||
allow_failures: | ||
- php: hhvm | ||
allow_failures: | ||
- php: nightly | ||
|
||
env: | ||
- TESTBENCH_VERSION=3.1.* | ||
- TESTBENCH_VERSION=3.2.* | ||
- TESTBENCH_VERSION=3.3.* | ||
|
||
before_script: | ||
- travis_retry composer self-update | ||
- travis_retry composer install --prefer-source --no-interaction --dev | ||
- travis_retry composer require --prefer-source --no-interaction --dev "orchestra/testbench:${TESTBENCH_VERSION}" | ||
|
||
script: | ||
- composer validate | ||
- mkdir -p build/logs | ||
- phpunit --coverage-text --coverage-clover=coverage.clover | ||
- vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover | ||
|
||
after_script: | ||
- wget https://scrutinizer-ci.com/ocular.phar | ||
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover | ||
- if [ "$TRAVIS_PHP_VERSION" != "nightly" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi | ||
- if [ "$TRAVIS_PHP_VERSION" != "nightly" ]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
The MIT License | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2010-2014 ARCANEDEV - GeoIP | ||
Copyright (c) 2015-2016 ARCANEDEV <[email protected]> - GeoIP | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,99 +1,42 @@ | ||
GeoIP for Laravel [![Packagist License](http://img.shields.io/packagist/l/arcanedev/geo-ip.svg?style=flat-square)](https://github.com/ARCANEDEV/GeoIP/blob/master/LICENSE) | ||
============== | ||
[![Travis Status](http://img.shields.io/travis/ARCANEDEV/GeoIP.svg?style=flat-square)](https://travis-ci.org/ARCANEDEV/GeoIP) | ||
[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/ARCANEDEV/GeoIP.svg?style=flat-square)](https://scrutinizer-ci.com/g/ARCANEDEV/GeoIP/?branch=master) | ||
[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/ARCANEDEV/GeoIP.svg?style=flat-square)](https://scrutinizer-ci.com/g/ARCANEDEV/GeoIP/?branch=master) | ||
[![Github Release](http://img.shields.io/github/release/ARCANEDEV/GeoIP.svg?style=flat-square)](https://github.com/ARCANEDEV/GeoIP/releases) | ||
[![Packagist Downloads](https://img.shields.io/packagist/dt/arcanedev/geo-ip.svg?style=flat-square)](https://packagist.org/packages/arcanedev/geo-ip) | ||
[![Github Issues](http://img.shields.io/github/issues/ARCANEDEV/GeoIP.svg?style=flat-square)](https://github.com/ARCANEDEV/GeoIP/issues) | ||
# GeoIP [![Packagist License][badge_license]](LICENSE.md) [![For ARCANEDEV][badge_laravel]](https://github.com/ARCANEDEV/GeoIP#geoip) | ||
|
||
*By [ARCANEDEV©](http://www.arcanedev.net/)* | ||
|
||
### Requirements | ||
|
||
- PHP >= 5.4.0 | ||
|
||
### Composer | ||
|
||
You can install the package via [Composer](http://getcomposer.org/). Add this to your `composer.json`: | ||
|
||
```json | ||
{ | ||
"require": { | ||
... | ||
"arcanedev/geo-ip": "~1.1" | ||
} | ||
} | ||
``` | ||
|
||
Then install via `composer install` or `composer update`. | ||
|
||
### Laravel Installation | ||
Once the package is installed, you can register the service provider in `app/config/app.php` in the `providers` array: | ||
[![Travis Status][badge_build]](https://travis-ci.org/ARCANEDEV/GeoIP) | ||
[![Coverage Status][badge_coverage]](https://scrutinizer-ci.com/g/ARCANEDEV/GeoIP/?branch=master) | ||
[![Scrutinizer Code Quality][badge_quality]](https://scrutinizer-ci.com/g/ARCANEDEV/GeoIP/?branch=master) | ||
[![SensioLabs Insight][badge_insight]](https://insight.sensiolabs.com/projects/4a10299d-26e2-4c86-8f39-9c3a3aa93e0f) | ||
[![Github Issues][badge_issues]](https://github.com/ARCANEDEV/GeoIP/issues) | ||
|
||
```php | ||
'providers' => [ | ||
... | ||
'Arcanedev\GeoIP\Laravel\ServiceProvider', | ||
], | ||
``` | ||
[![Packagist][badge_package]](https://packagist.org/packages/arcanedev/geoip) | ||
[![Packagist Release][badge_release]](https://packagist.org/packages/arcanedev/geoip) | ||
[![Packagist Downloads][badge_downloads]](https://packagist.org/packages/arcanedev/geoip) | ||
|
||
And the facade in the `aliases` array: | ||
|
||
```php | ||
'aliases' => [ | ||
... | ||
'GeoIP' => 'Arcanedev\GeoIP\Laravel\Facade', | ||
], | ||
``` | ||
|
||
#### Artisan Commands | ||
There are 2 commands available through this package: | ||
``` | ||
php artisan geo-ip:install | ||
``` | ||
|
||
Which simply migrate and seed all IPs and countries data for this package. Or | ||
*By [ARCANEDEV©](http://www.arcanedev.net/)* | ||
|
||
``` | ||
php artisan geo-ip:dump | ||
``` | ||
GeoIP package for Laravel. | ||
|
||
Which generate a SQL File for your database. | ||
Feel free to check out the [releases](https://github.com/ARCANEDEV/GeoIP/releases), [license](LICENSE.md), and [contribution guidelines](CONTRIBUTING.md). | ||
|
||
### Configuration | ||
Publish the package configuration by using this command: | ||
## Features | ||
|
||
``` | ||
php artisan config:publish arcanedev/geo-ip | ||
``` | ||
- Coming soon… | ||
|
||
Update your settings in the generated `app/config/packages/arcanedev/geo-ip` configuration file. | ||
## Security | ||
|
||
```php | ||
return [ | ||
'connection' => 'mysql', | ||
'prefix' => 'geo_', | ||
'table' => [ | ||
'nations' => 'nations', | ||
'countries' => 'countries', | ||
], | ||
'dump' => app_path() . '/database/geo-db.sql' | ||
]; | ||
``` | ||
If you discover any security related issues, please email [email protected] instead of using the issue tracker. | ||
|
||
## USAGE | ||
Coming soon ... | ||
## Contribution | ||
|
||
### TODOS: | ||
Any ideas are welcome. Feel free to submit any issues or pull requests, please check the [contribution guidelines](CONTRIBUTING.md). | ||
|
||
- [ ] Documentation | ||
- [ ] Examples | ||
- [x] More tests and code coverage | ||
- [x] Laravel Support (v4.2) | ||
- [ ] Laravel Support (v5.0) | ||
- [ ] Refactoring | ||
[badge_laravel]: https://img.shields.io/badge/For-Laravel%205.x-orange.svg?style=flat-square | ||
[badge_license]: https://img.shields.io/packagist/l/arcanedev/geo-ip.svg?style=flat-square | ||
|
||
### CREDIT | ||
[badge_build]: https://img.shields.io/travis/ARCANEDEV/GeoIP.svg?style=flat-square | ||
[badge_coverage]: https://img.shields.io/scrutinizer/coverage/g/ARCANEDEV/GeoIP.svg?style=flat-square | ||
[badge_quality]: https://img.shields.io/scrutinizer/g/ARCANEDEV/GeoIP.svg?style=flat-square | ||
[badge_insight]: https://img.shields.io/sensiolabs/i/4a10299d-26e2-4c86-8f39-9c3a3aa93e0f.svg?style=flat-square | ||
[badge_issues]: https://img.shields.io/github/issues/ARCANEDEV/GeoIP.svg?style=flat-square | ||
|
||
Thanks to [ip2nation.com](http://ip2nation.com/) for the database. | ||
[badge_package]: https://img.shields.io/badge/package-arcanedev/geo--ip-blue.svg?style=flat-square | ||
[badge_release]: https://img.shields.io/packagist/v/arcanedev/geo-ip.svg?style=flat-square | ||
[badge_downloads]: https://img.shields.io/packagist/dt/arcanedev/geo-ip.svg?style=flat-square |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,46 @@ | ||
{ | ||
"name": "arcanedev/geo-ip", | ||
"description": "GEO IP Helper", | ||
"keywords": ["geo", "ip", "localization", "nation", "country", "ip to long", "ip2long", "long2ip", "ip2nation", "laravel"], | ||
"description": "GeoIP package for Laravel 5.", | ||
"keywords": ["geoip", "geo-ip", "location", "geolocation", "maxmind", "ip-api", "laravel"], | ||
"type": "library", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "ARCANEDEV", | ||
"email": "[email protected]" | ||
"name": "ARCANEDEV", | ||
"email": "[email protected]", | ||
"homepage": "https://github.com/arcanedev-maroc", | ||
"role": "Developer" | ||
} | ||
], | ||
"require": { | ||
"php" : ">=5.4.0" | ||
"php": ">=5.6.4", | ||
"arcanedev/support": "~3.0", | ||
"guzzlehttp/guzzle": "~5.0|~6.0" | ||
}, | ||
"require-dev": { | ||
"orchestra/testbench": "~2.2", | ||
"phpunit/phpcov": "~2.0" | ||
"phpunit/phpcov": "~3.0", | ||
"phpunit/phpunit": "~5.0", | ||
"geoip2/geoip2": "~2.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Arcanedev\\GeoIP\\": "src/" | ||
}, | ||
"classmap": [ | ||
"src/Laravel/migrations" | ||
] | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Arcanedev\\GeoIP\\Tests\\": "tests/" | ||
} | ||
}, | ||
"minimum-stability": "stable" | ||
"scripts": { | ||
"testbench": "composer require --dev \"orchestra/testbench=~3.0\"" | ||
}, | ||
"extra": { | ||
"branch-alias": { | ||
"dev-master": "2.0-dev" | ||
} | ||
}, | ||
"suggest": { | ||
"geoip2/geoip2": "Required if you're going to use the MaxMind database or web service." | ||
} | ||
} |
Oops, something went wrong.