Skip to content

Commit

Permalink
Merge pull request #5 from ARCANEDEV/develop
Browse files Browse the repository at this point in the history
Updating the package (v2)
  • Loading branch information
arcanedev-maroc committed Dec 10, 2016
2 parents f0c0fd6 + 56ad75e commit 7e65fbb
Show file tree
Hide file tree
Showing 75 changed files with 2,965 additions and 64,750 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
@@ -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
3 changes: 2 additions & 1 deletion .gitattributes
@@ -1,5 +1,6 @@
/_docs export-ignore
/tests export-ignore
/examples export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.scrutinizer.yml export-ignore
Expand Down
10 changes: 4 additions & 6 deletions .gitignore
@@ -1,6 +1,4 @@
.idea/
_arcanedev/
build/
vendor/
composer.phar
composer.lock
/build/
/vendor/
/composer.lock
/composer.phar
10 changes: 6 additions & 4 deletions .scrutinizer.yml
@@ -1,6 +1,10 @@
filter:
excluded_paths: [tests/*, vendor/*]

checks:
php:
code_rating: true
duplication: true
remove_extra_empty_lines: true
remove_php_closing_tag: true
remove_trailing_whitespace: true
Expand All @@ -14,11 +18,11 @@ checks:
fix_line_ending: true
fix_identation_4spaces: true
fix_doc_comments: true

tools:
external_code_coverage:
timeout: 600
runs: 3
php_code_coverage: false
runs: 6
php_code_sniffer:
enabled: true
config:
Expand All @@ -27,7 +31,5 @@ tools:
paths: ['src']
php_loc:
enabled: true
excluded_dirs: [vendor, tests]
php_cpd:
enabled: true
excluded_dirs: [vendor, tests]
26 changes: 17 additions & 9 deletions .travis.yml
@@ -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
4 changes: 2 additions & 2 deletions LICENSE → LICENSE.md
@@ -1,6 +1,6 @@
The MIT License
The MIT License (MIT)

Copyright (c) 2010-2014 ARCANEDEV - GeoIP
Copyright (c) 2015-2016 ARCANEDEV <arcanedev.maroc@gmail.com> - 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
Expand Down
113 changes: 28 additions & 85 deletions README.md
@@ -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&copy;](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&copy;](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&hellip;

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 arcanedev-maroc@gmail.com 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
37 changes: 25 additions & 12 deletions composer.json
@@ -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": "arcanedev.maroc@gmail.com"
"name": "ARCANEDEV",
"email": "arcanedev.maroc@gmail.com",
"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."
}
}

0 comments on commit 7e65fbb

Please sign in to comment.