Upgrade to php 8

This commit is contained in:
Aldarien
2023-02-10 15:12:30 +00:00
parent b6c0c90943
commit de6100a546
9 changed files with 25 additions and 14 deletions

View File

@ -1,8 +1,8 @@
<?php
namespace App\Service;
use League\Uri\Http;
use League\Uri\Components\Host;
use League\Uri\Uri as Http;
use League\Uri\Components\Domain as Host;
use League\Uri\Components\HierarchicalPath;
class URL
@ -19,7 +19,13 @@ class URL
protected function findRoot()
{
$base = $_SERVER['HTTP_HOST'] . ((isset($_SERVER['HTTP_PORT'])) ? ':' . $_SERVER['HTTP_PORT'] : '');
$scheme = $_SERVER['HTTPS'] ? 'https' : 'http';
$scheme = 'http';
if (isset($_SERVER['REQUEST_SCHEME'])) {
$scheme = $_SERVER['REQUEST_SCHEME'];
}
if (isset($_SERVER['HTTPS'])) {
$scheme = 'https';
}
$uri = Http::createFromString(\Sabre\Uri\resolve($scheme . '://' . $base, $_SERVER['SCRIPT_NAME']));
$host = new Host($uri->getHost());
if ($host->isAbsolute()) {

View File

@ -6,6 +6,7 @@
"aldarien/contract" : "*",
"aldarien/root" : "*",
"league/uri": "*",
"league/uri-components": "*",
"sabre/uri": "*"
},
"require-dev" : {