deliver CSS and JS as external request

This commit is contained in:
tinect
2019-10-20 21:25:58 +02:00
parent 31eb169152
commit cc1bf5d426
4 changed files with 51 additions and 19 deletions

View File

@@ -3,15 +3,16 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/modals/footer.php';
logger();
?>
<div style="margin-bottom: 100px;"></div>
<script type='text/javascript'><?php
$JSPath = '/tmp/' . $js_minifier->getDataHash() . '.js';
if(file_exists($JSPath)) {
echo file_get_contents($JSPath);
} else {
echo $js_minifier->minify($JSPath);
cleanupJS($js_minifier->getDataHash());
}
?></script>
<?php
$hash = $js_minifier->getDataHash();
$JSPath = '/tmp/' . $hash . '.js';
if(!file_exists($JSPath)) {
$js_minifier->minify($JSPath);
cleanupJS($hash);
}
?>
<script src="/cache/<?=basename($JSPath)?>"></script>
<script>
<?php
$lang_footer = json_encode($lang['footer']);