Skip to content

Commit 562c4f7

Browse files
committed
Release v3.0.0 PHP SDK
1 parent 12f1454 commit 562c4f7

File tree

226 files changed

+3059
-62450
lines changed

Some content is hidden

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

226 files changed

+3059
-62450
lines changed

.github/workflows/php.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: PHP
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
php-version: ['8.1', '8.2', '8.3']
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Set up PHP
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: ${{ matrix.php-version }}
27+
extensions: curl
28+
coverage: none
29+
30+
- name: Validate Composer
31+
run: composer validate
32+
33+
- name: Install dependencies
34+
run: composer install --prefer-dist --no-interaction
35+
36+
- name: Run unit tests
37+
run: ./vendor/bin/phpunit --exclude-group live

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ composer.phar
55

66
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
77
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
8-
# composer.lock
8+
/composer.lock
99

1010
# php-cs-fixer cache
1111
.php_cs.cache
1212
.php-cs-fixer.cache
1313

1414
# PHPUnit cache
1515
.phpunit.result.cache
16+
.phpunit.cache/
17+
/coverage/
1618
/.idea/

.php-cs-fixer.dist.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
<?php
22

3-
/**
4-
* @generated
5-
* @link https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/HEAD/doc/config.rst
6-
*/
73
$finder = PhpCsFixer\Finder::create()
8-
->in(__DIR__)
4+
->in([
5+
__DIR__ . '/lib',
6+
__DIR__ . '/tests',
7+
])
98
->exclude('vendor')
10-
->exclude('test')
11-
->exclude('tests')
129
;
1310

1411
$config = new PhpCsFixer\Config();

.travis.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changelog
2+
3+
## 3.0.0
4+
5+
- Replaced the old multi-API SDK with the new PHP SDK for the IPGeolocation.io IP Location API.
6+
- Added typed and raw single lookup methods for `/v3/ipgeo`.
7+
- Added typed and raw bulk lookup methods for `/v3/ipgeo-bulk`.
8+
- Added request validation, metadata parsing, and explicit error mapping.

README.md

100755100644
Lines changed: 287 additions & 2018 deletions
Large diffs are not rendered by default.

composer.json

100755100644
Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,67 @@
11
{
22
"name": "ipgeolocation/ipgeolocation-php-sdk",
3-
"description": "Ipgeolocation provides a set of APIs to make ip based decisions.",
3+
"description": "Official PHP SDK for the IPGeolocation.io IP Location API with single and bulk lookup support.",
44
"keywords": [
55
"ipgeolocation",
6-
"ip-tools",
76
"geolocation",
7+
"ip",
8+
"ip-location",
9+
"ip-geolocation",
10+
"ip-lookup",
811
"php",
912
"sdk",
10-
"rest",
11-
"api"
13+
"api",
14+
"ipv4",
15+
"ipv6",
16+
"domain-lookup",
17+
"hostname",
18+
"security",
19+
"abuse",
20+
"asn",
21+
"timezone",
22+
"user-agent",
23+
"bulk-lookup"
1224
],
1325
"homepage": "https://ipgeolocation.io",
26+
"support": {
27+
"docs": "https://ipgeolocation.io/documentation/ip-location-api.html",
28+
"issues": "https://github.com/IPGeolocation/ip-geolocation-api-php/issues",
29+
"source": "https://github.com/IPGeolocation/ip-geolocation-api-php"
30+
},
1431
"license": "Apache-2.0",
1532
"authors": [
1633
{
17-
"name": "Ipgeolocation",
34+
"name": "IPGeolocation.io",
1835
"homepage": "https://ipgeolocation.io"
1936
}
2037
],
2138
"require": {
2239
"php": "^8.1",
2340
"ext-curl": "*",
2441
"ext-json": "*",
25-
"ext-mbstring": "*",
26-
"guzzlehttp/guzzle": "^7.3",
27-
"guzzlehttp/psr7": "^1.7 || ^2.0"
42+
"guzzlehttp/guzzle": "^7.8"
2843
},
2944
"require-dev": {
30-
"phpunit/phpunit": "^12.2",
31-
"friendsofphp/php-cs-fixer": "^3.5"
45+
"friendsofphp/php-cs-fixer": "^3.64",
46+
"phpunit/phpunit": "^10.5"
3247
},
3348
"autoload": {
34-
"psr-4": { "Ipgeolocation\\Sdk\\" : "lib/" }
49+
"psr-4": {
50+
"Ipgeolocation\\Sdk\\": "lib/"
51+
},
52+
"files": [
53+
"lib/Exceptions.php",
54+
"lib/Models.php"
55+
]
3556
},
3657
"autoload-dev": {
37-
"psr-4": { "Ipgeolocation\\Sdk\\Test\\" : "test/" }
58+
"psr-4": {
59+
"Ipgeolocation\\Sdk\\Test\\": "tests/ip_location/"
60+
}
61+
},
62+
"scripts": {
63+
"test": "vendor/bin/phpunit",
64+
"test:unit": "vendor/bin/phpunit --exclude-group live",
65+
"test:live": "vendor/bin/phpunit --group live"
3866
}
3967
}

0 commit comments

Comments
 (0)