Reverting APP_PATH to APP_URL
This commit is contained in:
parent
1a86abeb2d
commit
bc4468c5ab
|
@ -2,10 +2,6 @@
|
||||||
namespace App\Helpers;
|
namespace App\Helpers;
|
||||||
|
|
||||||
class Misc {
|
class Misc {
|
||||||
static private function isSecure() {
|
|
||||||
return (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443;
|
|
||||||
}
|
|
||||||
|
|
||||||
static public function getCursor(): int {
|
static public function getCursor(): int {
|
||||||
return isset($_GET['cursor']) && is_numeric($_GET['cursor']) ? (int) $_GET['cursor'] : 0;
|
return isset($_GET['cursor']) && is_numeric($_GET['cursor']) ? (int) $_GET['cursor'] : 0;
|
||||||
}
|
}
|
||||||
|
@ -15,9 +11,7 @@ class Misc {
|
||||||
}
|
}
|
||||||
|
|
||||||
static public function url(string $endpoint = ''): string {
|
static public function url(string $endpoint = ''): string {
|
||||||
$protocol = self::isSecure() ? 'https' : 'http';
|
return self::env('APP_URL', '') . $endpoint;
|
||||||
$root = $protocol . '://' . $_SERVER['HTTP_HOST'];
|
|
||||||
return $root . self::env('APP_PATH', '') . $endpoint;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static public function env(string $key, $default_value) {
|
static public function env(string $key, $default_value) {
|
||||||
|
|
Loading…
Reference in a new issue