Skip to content

Commit 7e65fbb

Browse files
Merge pull request #5 from ARCANEDEV/develop
Updating the package (v2)
2 parents f0c0fd6 + 56ad75e commit 7e65fbb

File tree

75 files changed

+2965
-64750
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+2965
-64750
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This file is for unifying the coding style for different editors and IDEs
2+
# editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
end_of_line = lf
8+
charset = utf-8
9+
indent_style = space
10+
indent_size = 4
11+
trim_trailing_whitespace = true
12+
insert_final_newline = true
13+
14+
[*.md]
15+
indent_size = 2

.gitattributes

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
/_docs export-ignore
12
/tests export-ignore
2-
/examples export-ignore
3+
/.editorconfig export-ignore
34
/.gitattributes export-ignore
45
/.gitignore export-ignore
56
/.scrutinizer.yml export-ignore

.gitignore

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
.idea/
2-
_arcanedev/
3-
build/
4-
vendor/
5-
composer.phar
6-
composer.lock
1+
/build/
2+
/vendor/
3+
/composer.lock
4+
/composer.phar

.scrutinizer.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
filter:
2+
excluded_paths: [tests/*, vendor/*]
3+
14
checks:
25
php:
36
code_rating: true
7+
duplication: true
48
remove_extra_empty_lines: true
59
remove_php_closing_tag: true
610
remove_trailing_whitespace: true
@@ -14,11 +18,11 @@ checks:
1418
fix_line_ending: true
1519
fix_identation_4spaces: true
1620
fix_doc_comments: true
21+
1722
tools:
1823
external_code_coverage:
1924
timeout: 600
20-
runs: 3
21-
php_code_coverage: false
25+
runs: 6
2226
php_code_sniffer:
2327
enabled: true
2428
config:
@@ -27,7 +31,5 @@ tools:
2731
paths: ['src']
2832
php_loc:
2933
enabled: true
30-
excluded_dirs: [vendor, tests]
3134
php_cpd:
3235
enabled: true
33-
excluded_dirs: [vendor, tests]

.travis.yml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,31 @@
11
language: php
22

3+
sudo: false
4+
35
php:
4-
- 5.4
5-
- 5.5
66
- 5.6
7-
- hhvm
7+
- 7.0
8+
- 7.1
9+
- nightly
810

911
matrix:
10-
allow_failures:
11-
- php: hhvm
12+
allow_failures:
13+
- php: nightly
14+
15+
env:
16+
- TESTBENCH_VERSION=3.1.*
17+
- TESTBENCH_VERSION=3.2.*
18+
- TESTBENCH_VERSION=3.3.*
1219

1320
before_script:
1421
- travis_retry composer self-update
15-
- travis_retry composer install --prefer-source --no-interaction --dev
22+
- travis_retry composer require --prefer-source --no-interaction --dev "orchestra/testbench:${TESTBENCH_VERSION}"
1623

1724
script:
25+
- composer validate
1826
- mkdir -p build/logs
19-
- phpunit --coverage-text --coverage-clover=coverage.clover
27+
- vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
2028

2129
after_script:
22-
- wget https://scrutinizer-ci.com/ocular.phar
23-
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
30+
- if [ "$TRAVIS_PHP_VERSION" != "nightly" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi
31+
- if [ "$TRAVIS_PHP_VERSION" != "nightly" ]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi

LICENSE renamed to LICENSE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
The MIT License
1+
The MIT License (MIT)
22

3-
Copyright (c) 2010-2014 ARCANEDEV - GeoIP
3+
Copyright (c) 2015-2016 ARCANEDEV <arcanedev.maroc@gmail.com> - GeoIP
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 28 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,42 @@
1-
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)
2-
==============
3-
[![Travis Status](http://img.shields.io/travis/ARCANEDEV/GeoIP.svg?style=flat-square)](https://travis-ci.org/ARCANEDEV/GeoIP)
4-
[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/ARCANEDEV/GeoIP.svg?style=flat-square)](https://scrutinizer-ci.com/g/ARCANEDEV/GeoIP/?branch=master)
5-
[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/ARCANEDEV/GeoIP.svg?style=flat-square)](https://scrutinizer-ci.com/g/ARCANEDEV/GeoIP/?branch=master)
6-
[![Github Release](http://img.shields.io/github/release/ARCANEDEV/GeoIP.svg?style=flat-square)](https://github.com/ARCANEDEV/GeoIP/releases)
7-
[![Packagist Downloads](https://img.shields.io/packagist/dt/arcanedev/geo-ip.svg?style=flat-square)](https://packagist.org/packages/arcanedev/geo-ip)
8-
[![Github Issues](http://img.shields.io/github/issues/ARCANEDEV/GeoIP.svg?style=flat-square)](https://github.com/ARCANEDEV/GeoIP/issues)
1+
# GeoIP [![Packagist License][badge_license]](LICENSE.md) [![For ARCANEDEV][badge_laravel]](https://github.com/ARCANEDEV/GeoIP#geoip)
92

10-
*By [ARCANEDEV&copy;](http://www.arcanedev.net/)*
11-
12-
### Requirements
13-
14-
- PHP >= 5.4.0
15-
16-
### Composer
17-
18-
You can install the package via [Composer](http://getcomposer.org/). Add this to your `composer.json`:
19-
20-
```json
21-
{
22-
"require": {
23-
...
24-
"arcanedev/geo-ip": "~1.1"
25-
}
26-
}
27-
```
28-
29-
Then install via `composer install` or `composer update`.
30-
31-
### Laravel Installation
32-
Once the package is installed, you can register the service provider in `app/config/app.php` in the `providers` array:
3+
[![Travis Status][badge_build]](https://travis-ci.org/ARCANEDEV/GeoIP)
4+
[![Coverage Status][badge_coverage]](https://scrutinizer-ci.com/g/ARCANEDEV/GeoIP/?branch=master)
5+
[![Scrutinizer Code Quality][badge_quality]](https://scrutinizer-ci.com/g/ARCANEDEV/GeoIP/?branch=master)
6+
[![SensioLabs Insight][badge_insight]](https://insight.sensiolabs.com/projects/4a10299d-26e2-4c86-8f39-9c3a3aa93e0f)
7+
[![Github Issues][badge_issues]](https://github.com/ARCANEDEV/GeoIP/issues)
338

34-
```php
35-
'providers' => [
36-
...
37-
'Arcanedev\GeoIP\Laravel\ServiceProvider',
38-
],
39-
```
9+
[![Packagist][badge_package]](https://packagist.org/packages/arcanedev/geoip)
10+
[![Packagist Release][badge_release]](https://packagist.org/packages/arcanedev/geoip)
11+
[![Packagist Downloads][badge_downloads]](https://packagist.org/packages/arcanedev/geoip)
4012

41-
And the facade in the `aliases` array:
42-
43-
```php
44-
'aliases' => [
45-
...
46-
'GeoIP' => 'Arcanedev\GeoIP\Laravel\Facade',
47-
],
48-
```
49-
50-
#### Artisan Commands
51-
There are 2 commands available through this package:
52-
```
53-
php artisan geo-ip:install
54-
```
55-
56-
Which simply migrate and seed all IPs and countries data for this package. Or
13+
*By [ARCANEDEV&copy;](http://www.arcanedev.net/)*
5714

58-
```
59-
php artisan geo-ip:dump
60-
```
15+
GeoIP package for Laravel.
6116

62-
Which generate a SQL File for your database.
17+
Feel free to check out the [releases](https://github.com/ARCANEDEV/GeoIP/releases), [license](LICENSE.md), and [contribution guidelines](CONTRIBUTING.md).
6318

64-
### Configuration
65-
Publish the package configuration by using this command:
19+
## Features
6620

67-
```
68-
php artisan config:publish arcanedev/geo-ip
69-
```
21+
- Coming soon&hellip;
7022

71-
Update your settings in the generated `app/config/packages/arcanedev/geo-ip` configuration file.
23+
## Security
7224

73-
```php
74-
return [
75-
'connection' => 'mysql',
76-
'prefix' => 'geo_',
77-
'table' => [
78-
'nations' => 'nations',
79-
'countries' => 'countries',
80-
],
81-
'dump' => app_path() . '/database/geo-db.sql'
82-
];
83-
```
25+
If you discover any security related issues, please email arcanedev-maroc@gmail.com instead of using the issue tracker.
8426

85-
## USAGE
86-
Coming soon ...
27+
## Contribution
8728

88-
### TODOS:
29+
Any ideas are welcome. Feel free to submit any issues or pull requests, please check the [contribution guidelines](CONTRIBUTING.md).
8930

90-
- [ ] Documentation
91-
- [ ] Examples
92-
- [x] More tests and code coverage
93-
- [x] Laravel Support (v4.2)
94-
- [ ] Laravel Support (v5.0)
95-
- [ ] Refactoring
31+
[badge_laravel]: https://img.shields.io/badge/For-Laravel%205.x-orange.svg?style=flat-square
32+
[badge_license]: https://img.shields.io/packagist/l/arcanedev/geo-ip.svg?style=flat-square
9633

97-
### CREDIT
34+
[badge_build]: https://img.shields.io/travis/ARCANEDEV/GeoIP.svg?style=flat-square
35+
[badge_coverage]: https://img.shields.io/scrutinizer/coverage/g/ARCANEDEV/GeoIP.svg?style=flat-square
36+
[badge_quality]: https://img.shields.io/scrutinizer/g/ARCANEDEV/GeoIP.svg?style=flat-square
37+
[badge_insight]: https://img.shields.io/sensiolabs/i/4a10299d-26e2-4c86-8f39-9c3a3aa93e0f.svg?style=flat-square
38+
[badge_issues]: https://img.shields.io/github/issues/ARCANEDEV/GeoIP.svg?style=flat-square
9839

99-
Thanks to [ip2nation.com](http://ip2nation.com/) for the database.
40+
[badge_package]: https://img.shields.io/badge/package-arcanedev/geo--ip-blue.svg?style=flat-square
41+
[badge_release]: https://img.shields.io/packagist/v/arcanedev/geo-ip.svg?style=flat-square
42+
[badge_downloads]: https://img.shields.io/packagist/dt/arcanedev/geo-ip.svg?style=flat-square

composer.json

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,46 @@
11
{
22
"name": "arcanedev/geo-ip",
3-
"description": "GEO IP Helper",
4-
"keywords": ["geo", "ip", "localization", "nation", "country", "ip to long", "ip2long", "long2ip", "ip2nation", "laravel"],
3+
"description": "GeoIP package for Laravel 5.",
4+
"keywords": ["geoip", "geo-ip", "location", "geolocation", "maxmind", "ip-api", "laravel"],
5+
"type": "library",
56
"license": "MIT",
67
"authors": [
78
{
8-
"name": "ARCANEDEV",
9-
"email": "arcanedev.maroc@gmail.com"
9+
"name": "ARCANEDEV",
10+
"email": "arcanedev.maroc@gmail.com",
11+
"homepage": "https://github.com/arcanedev-maroc",
12+
"role": "Developer"
1013
}
1114
],
1215
"require": {
13-
"php" : ">=5.4.0"
16+
"php": ">=5.6.4",
17+
"arcanedev/support": "~3.0",
18+
"guzzlehttp/guzzle": "~5.0|~6.0"
1419
},
1520
"require-dev": {
16-
"orchestra/testbench": "~2.2",
17-
"phpunit/phpcov": "~2.0"
21+
"phpunit/phpcov": "~3.0",
22+
"phpunit/phpunit": "~5.0",
23+
"geoip2/geoip2": "~2.0"
1824
},
1925
"autoload": {
2026
"psr-4": {
2127
"Arcanedev\\GeoIP\\": "src/"
22-
},
23-
"classmap": [
24-
"src/Laravel/migrations"
25-
]
28+
}
2629
},
2730
"autoload-dev": {
2831
"psr-4": {
2932
"Arcanedev\\GeoIP\\Tests\\": "tests/"
3033
}
3134
},
32-
"minimum-stability": "stable"
35+
"scripts": {
36+
"testbench": "composer require --dev \"orchestra/testbench=~3.0\""
37+
},
38+
"extra": {
39+
"branch-alias": {
40+
"dev-master": "2.0-dev"
41+
}
42+
},
43+
"suggest": {
44+
"geoip2/geoip2": "Required if you're going to use the MaxMind database or web service."
45+
}
3346
}

0 commit comments

Comments
 (0)