From b792dca23be8806a17f7734133d11814d29bb980 Mon Sep 17 00:00:00 2001 From: freya Date: Wed, 25 Sep 2024 16:25:50 +0000 Subject: [PATCH] use asse_stamp for get_url --- src/web/core/core.php | 12 ++++++------ src/web/index.php | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/web/core/core.php b/src/web/core/core.php index 3b23410..f1ce07e 100644 --- a/src/web/core/core.php +++ b/src/web/core/core.php @@ -25,7 +25,7 @@ abstract class Core { { if (ENVIRONMENT == 'devlopment') return time(); - $path = PUBLIC_ROOT . '/' . $path; + $path = PHP_ROOT . '/' . $path; return @filemtime($path); } @@ -48,7 +48,7 @@ abstract class Core { $base = lang('base_path'); $url = "{$scheme}://{$host}{$base}{$path}"; if ($timestamp) { - $time = @filemtime(PHP_ROOT . '/' . $path); + $time = Core::asset_stamp($path); $url .= "?timestamp={$time}"; } return $url; @@ -60,8 +60,8 @@ abstract class Core { */ public static function link_js(string $path): string { - $stamp = Core::asset_stamp($path); - $href = Core::get_url("public/{$path}?stamp={$stamp}"); + $stamp = Core::asset_stamp("public/$path"); + $href = Core::get_url("public/{$path}?timestamp={$stamp}"); return ''; } @@ -71,8 +71,8 @@ abstract class Core { */ public static function link_css(string $path): string { - $stamp = Core::asset_stamp($path); - $href = Core::get_url("public/{$path}?stamp={$stamp}"); + $stamp = Core::asset_stamp("public/$path"); + $href = Core::get_url("public/{$path}?timestamp={$stamp}"); return ''; } diff --git a/src/web/index.php b/src/web/index.php index bc9eeff..63e5b61 100644 --- a/src/web/index.php +++ b/src/web/index.php @@ -18,7 +18,7 @@ define('ENVIRONMENT', 'devlopment'); // FOLDER_ROOT // // define folder directiroy paths based on this file -define('PHP_ROOT', dirname(__FILE__) . '/..'); +define('PHP_ROOT', realpath(dirname(__FILE__) . '/..')); define('WEB_ROOT', PHP_ROOT . '/web'); define('ASSET_ROOT', PHP_ROOT . '/assets'); define('PUBLIC_ROOT', PHP_ROOT . '/public');