Skip to content

Commit 1807f00

Browse files
committed
Merge branch 'release-v7' of github.com:inex/IXP-Manager into release-v7
2 parents 2e54ebd + 477d808 commit 1807f00

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

Diff for: app/Console/Commands/InManrs.php

+10-3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
*/
2525
use Illuminate\Support\Facades\DB;
2626

27+
use Illuminate\Support\Facades\Http;
2728
use IXP\Models\Customer;
2829
/**
2930
* Artisan command to update the in_peeringdb flag of members
@@ -59,12 +60,18 @@ class InManrs extends Command
5960
public function handle(): int
6061
{
6162
// get list of peeringdb networks:
62-
if( !( $json = file_get_contents( 'https://www.manrs.org/wp-json/manrs/v1/asn' ) ) ) {
63-
$this->error( 'Could not load ASNs via MANRS\'s API' );
63+
try {
64+
$resp = Http::withHeaders( [
65+
'X-Request-Client' => 'IXP Manager',
66+
'X-Request-Client-Version' => APPLICATION_VERSION,
67+
] )->throw()->acceptJson()
68+
->get( 'https://api.manrs.org/asns' );
69+
} catch(\Exception $e) {
70+
$this->error( 'Could not load ASNs via MANRS\'s API: ' . $e->getMessage() );
6471
return 1;
6572
}
6673

67-
$asns = json_decode( $json, true );
74+
$asns = $resp['asns'];
6875

6976
if( !is_array( $asns ) || !count( $asns ) ) {
7077
$this->error( 'Empty or no ASNs returned from MANRS\'s API' );

Diff for: artisan

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ require __DIR__.'/vendor/autoload.php';
2121

2222
$app = require_once __DIR__.'/bootstrap/app.php';
2323

24+
require_once base_path() . '/version.php';
25+
2426
/*
2527
|--------------------------------------------------------------------------
2628
| Run The Artisan Application

Diff for: public/index.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181

8282
$app = require_once __DIR__.'/../bootstrap/app.php';
8383

84-
include base_path() . '/version.php';
84+
require_once base_path() . '/version.php';
8585

8686
$kernel = $app->make( Kernel::class );
8787

0 commit comments

Comments
 (0)