Compare commits

..

1 commit

Author SHA1 Message Date
0e5b786f58
feat: read version number from composer.json
this enables any cached css files to automatically to be discarded on release of a new version.

Signed-off-by: Zoë <code@moiety.me>
2025-05-05 22:47:09 +02:00
2 changed files with 15 additions and 10 deletions

View file

@ -30,13 +30,10 @@ class ExportController extends Controller
} }
array_push($list, ["heatRating" => $rating, "ratingCount" => $count]); array_push($list, ["heatRating" => $rating, "ratingCount" => $count]);
} }
return view( return view('front.exports', [
'front.exports', 'title' => "Exports",
[ 'list' => $list
'title' => "Exports", ]);
'list' => $list
]
);
} }
// //
@ -80,7 +77,7 @@ class ExportController extends Controller
} }
header('Content-Type: text/csv'); header('Content-Type: text/csv');
header('Content-Disposition: attachment; filename=' . $type . "-" . $percent . ".csv"); header('Content-Disposition: attachment; filename=' . $type . "-" . $percent);
echo implode(',', $columns) . PHP_EOL; echo implode(',', $columns) . PHP_EOL;
foreach ($list as $item) { foreach ($list as $item) {

View file

@ -1,3 +1,11 @@
<?php
// Get and decode composer.json
$content = file_get_contents(__DIR__ . '/../../../composer.json');
$content = json_decode($content, true);
// Get the version number
$version = $content['version'];
?>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
@ -9,9 +17,9 @@
@yield('title') @yield('title')
</title> </title>
@if(isset($front) && $front == false) @if(isset($front) && $front == false)
<link rel="stylesheet" type="text/css" href="/assets/css/back/start.css?=sdfsdf">
@elseif(!isset($front) || $front == true) @elseif(!isset($front) || $front == true)
<link rel="stylesheet" type="text/css" href="/assets/css/front/start.css?=sdfsdf"> <link rel="stylesheet" type="text/css" href="/assets/css/back/start.css?v=<?php echo($version); ?>">
<link rel="stylesheet" type="text/css" href="/assets/css/front/start.css?v=<?php echo($version); ?>">
@endif @endif
</head> </head>