mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-17 23:20:50 +08:00
62 lines
1.3 KiB
PHP
62 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use App\Models\Exam;
|
|
use App\Models\ExamProgress;
|
|
use App\Models\ExamUser;
|
|
use App\Models\SearchBox;
|
|
use App\Models\User;
|
|
use App\Repositories\ExamRepository;
|
|
use App\Repositories\SearchBoxRepository;
|
|
use App\Repositories\TorrentRepository;
|
|
use Carbon\Carbon;
|
|
use GeoIp2\Database\Reader;
|
|
use Illuminate\Console\Command;
|
|
use Illuminate\Encryption\Encrypter;
|
|
use Illuminate\Support\Facades\DB;
|
|
use Illuminate\Support\Facades\Hash;
|
|
use Illuminate\Support\Facades\Storage;
|
|
|
|
class Test extends Command
|
|
{
|
|
/**
|
|
* The name and signature of the console command.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $signature = 'test:test';
|
|
|
|
/**
|
|
* The console command description.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $description = 'Just for test';
|
|
|
|
/**
|
|
* Create a new command instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
|
|
/**
|
|
* Execute the console command.
|
|
*
|
|
* @return int
|
|
*/
|
|
public function handle()
|
|
{
|
|
$reader = new Reader(resource_path('geoip/GeoLite2-City.mmdb'));
|
|
$record = $reader->city('128.101.101.101');
|
|
dump($record->city, $record->country, $record->location);
|
|
$record2 = $reader->isp('128.101.101.101');
|
|
dump($record2->isp);
|
|
}
|
|
|
|
}
|