Upgrade to php 8
This commit is contained in:
@ -122,7 +122,11 @@ class Config
|
||||
$ini = strpos($value, '{') + 1;
|
||||
$end = strpos($value, '}', $ini);
|
||||
$rep = substr($value, $ini, $end - $ini);
|
||||
$value = str_replace('{' . $rep . '}', $this->get($rep), $value);
|
||||
$new = $this->get($rep);
|
||||
if ($new === null) {
|
||||
$new = '';
|
||||
}
|
||||
$value = str_replace('{' . $rep . '}', $new, $value);
|
||||
}
|
||||
}
|
||||
return $value;
|
||||
|
@ -59,4 +59,4 @@ class Response
|
||||
return false;
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
@ -3,7 +3,7 @@
|
||||
"description" : "Response handler module for my apps",
|
||||
"type" : "library",
|
||||
"require" : {
|
||||
"wixel/gump" : "*",
|
||||
"wixel/gump" : "^2.0",
|
||||
"aldarien/contract" : "*"
|
||||
},
|
||||
"require-dev" : {
|
||||
|
@ -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()) {
|
||||
|
@ -6,6 +6,7 @@
|
||||
"aldarien/contract" : "*",
|
||||
"aldarien/root" : "*",
|
||||
"league/uri": "*",
|
||||
"league/uri-components": "*",
|
||||
"sabre/uri": "*"
|
||||
},
|
||||
"require-dev" : {
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace App\Service;
|
||||
|
||||
use Philo\Blade\Blade;
|
||||
use eftec\bladeone\BladeOne;
|
||||
|
||||
class View
|
||||
{
|
||||
@ -14,14 +14,14 @@ class View
|
||||
$this->views = config('locations.views');
|
||||
$this->cache = config('locations.cache');
|
||||
|
||||
$this->blade = new Blade($this->views, $this->cache);
|
||||
$this->blade = new BladeOne($this->views, $this->cache);
|
||||
}
|
||||
public function show($template, $vars = null)
|
||||
{
|
||||
if ($vars) {
|
||||
return $this->blade->view()->make($template, $vars)->render();
|
||||
return $this->blade->run($template, $vars);
|
||||
}
|
||||
return $this->blade->view()->make($template)->render();
|
||||
return $this->blade->run($template);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -3,7 +3,7 @@
|
||||
"description": "View module for my apps",
|
||||
"type": "library",
|
||||
"require": {
|
||||
"philo/laravel-blade": "*",
|
||||
"eftec/bladeone": "*",
|
||||
"aldarien/contract": "*",
|
||||
"aldarien/config": "*"
|
||||
},
|
||||
|
Reference in New Issue
Block a user