mirror of
https://github.com/LinkStackOrg/LinkStack.git
synced 2025-04-19 04:37:18 +02:00
Add minimum PHP version
This commit is contained in:
parent
ff4e3b3d83
commit
591e3743f5
@ -4,8 +4,17 @@ use Illuminate\Support\Facades\Schema;
|
|||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
use App\Models\Link;
|
use App\Models\Link;
|
||||||
|
|
||||||
|
$minPhpVersion = '8.1.0';
|
||||||
|
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
|
|
||||||
|
if (version_compare(PHP_VERSION, $minPhpVersion, '<')) {
|
||||||
|
|
||||||
|
session(['update_error' => "This update requires at least PHP version $minPhpVersion. Your current PHP version is " . PHP_VERSION]);
|
||||||
|
echo "<meta http-equiv='refresh' content='0;" . url()->current() . "/?error' />";
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if(!isset($preUpdateServer)){$preUpdateServer = 'https://pre-update.linkstack.org/';}
|
if(!isset($preUpdateServer)){$preUpdateServer = 'https://pre-update.linkstack.org/';}
|
||||||
$file = Http::timeout(10)->get($preUpdateServer . 'update')->body();
|
$file = Http::timeout(10)->get($preUpdateServer . 'update')->body();
|
||||||
@ -81,3 +90,5 @@ if (!Schema::hasColumn('links', 'type_params')) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user