Skip to content

Commit

Permalink
Merge branch 'release-v7' of github.com:inex/IXP-Manager into release-v7
Browse files Browse the repository at this point in the history
  • Loading branch information
barryo committed Jan 25, 2025
2 parents 2e54ebd + 477d808 commit 1807f00
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
13 changes: 10 additions & 3 deletions app/Console/Commands/InManrs.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
*/
use Illuminate\Support\Facades\DB;

use Illuminate\Support\Facades\Http;
use IXP\Models\Customer;
/**
* Artisan command to update the in_peeringdb flag of members
Expand Down Expand Up @@ -59,12 +60,18 @@ class InManrs extends Command
public function handle(): int
{
// get list of peeringdb networks:
if( !( $json = file_get_contents( 'https://www.manrs.org/wp-json/manrs/v1/asn' ) ) ) {
$this->error( 'Could not load ASNs via MANRS\'s API' );
try {
$resp = Http::withHeaders( [
'X-Request-Client' => 'IXP Manager',
'X-Request-Client-Version' => APPLICATION_VERSION,

Check failure on line 66 in app/Console/Commands/InManrs.php

View workflow job for this annotation

GitHub Actions / ci-ex-dusk

UndefinedConstant

app/Console/Commands/InManrs.php:66:47: UndefinedConstant: Const APPLICATION_VERSION is not defined (see https://psalm.dev/020)
] )->throw()->acceptJson()
->get( 'https://api.manrs.org/asns' );
} catch(\Exception $e) {
$this->error( 'Could not load ASNs via MANRS\'s API: ' . $e->getMessage() );
return 1;
}

$asns = json_decode( $json, true );
$asns = $resp['asns'];

if( !is_array( $asns ) || !count( $asns ) ) {
$this->error( 'Empty or no ASNs returned from MANRS\'s API' );
Expand Down
2 changes: 2 additions & 0 deletions artisan
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ require __DIR__.'/vendor/autoload.php';

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

require_once base_path() . '/version.php';

/*
|--------------------------------------------------------------------------
| Run The Artisan Application
Expand Down
2 changes: 1 addition & 1 deletion public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@

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

include base_path() . '/version.php';
require_once base_path() . '/version.php';

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

Expand Down

0 comments on commit 1807f00

Please sign in to comment.