summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfreya <Freya Murphy>2024-09-25 16:25:50 +0000
committerfreya <Freya Murphy>2024-09-25 16:25:50 +0000
commitb792dca23be8806a17f7734133d11814d29bb980 (patch)
tree6bc07e08ea41d2cf526d1decc13987d311aff63e
parentgive https urls if in a https context (diff)
downloadwebsite-b792dca23be8806a17f7734133d11814d29bb980.tar.gz
website-b792dca23be8806a17f7734133d11814d29bb980.tar.bz2
website-b792dca23be8806a17f7734133d11814d29bb980.zip
use asse_stamp for get_url
-rw-r--r--src/web/core/core.php12
-rw-r--r--src/web/index.php2
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 '<script src="'. $href .'"></script>';
}
@@ -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 '<link rel="stylesheet" href="'. $href .'">';
}
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');