-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: begin refactoring, add timestamps to ip table * Apply fixes from StyleCI * additional properties, cli command, remove IPStack * Apply fixes from StyleCI * feat: support batch requests when using IPAPI * Apply fixes from StyleCI * centralize ip retrieval * feat: respect rate limits, add ipapi-pro, wip: lookup later * Apply fixes from StyleCI * use dep inj rather than resolve * Apply fixes from StyleCI * chore: update meta * chore: php8 self promotion * chore: php 8.3 --------- Co-authored-by: StyleCI Bot <[email protected]>
- Loading branch information
1 parent
ab9765f
commit 6e577e7
Showing
33 changed files
with
932 additions
and
251 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
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 |
---|---|---|
|
@@ -28,6 +28,11 @@ | |
"name": "David Sevilla Martin", | ||
"email": "[email protected]", | ||
"role": "Developer" | ||
}, | ||
{ | ||
"name": "IanM", | ||
"email": "[email protected]", | ||
"role": "Developer" | ||
} | ||
], | ||
"autoload": { | ||
|
@@ -58,7 +63,8 @@ | |
} | ||
}, | ||
"require-dev": { | ||
"flarum/phpstan": "*" | ||
"flarum/phpstan": "*", | ||
"fof/drafts": "*" | ||
}, | ||
"scripts": { | ||
"analyse:phpstan": "phpstan analyse", | ||
|
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
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
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
17 changes: 17 additions & 0 deletions
17
migrations/2023_11_09_000000_add_timestamps_to_ip_info_table.php
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,17 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of fof/geoip. | ||
* | ||
* Copyright (c) FriendsOfFlarum. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
use Flarum\Database\Migration; | ||
|
||
return Migration::addColumns('ip_info', [ | ||
'created_at' => ['timestamp', 'nullable' => false, 'useCurrent' => true], | ||
'updated_at' => ['datetime', 'nullable' => true], | ||
]); |
34 changes: 34 additions & 0 deletions
34
migrations/2023_11_09_000001_add_additional_ip_properties_to_ip_info_table.php
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,34 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of fof/geoip. | ||
* | ||
* Copyright (c) FriendsOfFlarum. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Database\Schema\Builder; | ||
|
||
return [ | ||
'up' => function (Builder $schema) { | ||
$schema->table('ip_info', function (Blueprint $table) { | ||
$table->string('latitude')->after('zip_code')->nullable(); | ||
$table->string('longitude')->after('latitude')->nullable(); | ||
$table->string('as')->after('organization')->nullable(); | ||
$table->boolean('mobile')->after('address')->nullable(); | ||
$table->string('data_provider')->after('error')->nullable(); | ||
}); | ||
}, | ||
'down' => function (Builder $schema) { | ||
$schema->table('ip_info', function (Blueprint $table) { | ||
$table->dropColumn('latitude'); | ||
$table->dropColumn('longitude'); | ||
$table->dropColumn('as'); | ||
$table->dropColumn('mobile'); | ||
$table->dropColumn('data_provider'); | ||
}); | ||
}, | ||
]; |
26 changes: 26 additions & 0 deletions
26
migrations/2023_11_09_000002_update_settings_remove_ipstack_service.php
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,26 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of fof/geoip. | ||
* | ||
* Copyright (c) FriendsOfFlarum. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
use Illuminate\Database\Schema\Builder; | ||
|
||
return [ | ||
'up' => function (Builder $schema) { | ||
$db = $schema->getConnection(); | ||
|
||
$db->table('settings') | ||
->where('key', 'fof-geoip.service') | ||
->where('value', 'ipstack') | ||
->delete(); | ||
}, | ||
'down' => function (Builder $schema) { | ||
// | ||
}, | ||
]; |
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
Oops, something went wrong.