Fix style.min.css updating
This commit is contained in:
parent
92846965f4
commit
925335b6f9
14
index.php
14
index.php
@ -105,20 +105,18 @@ if (badQuery()) {
|
|||||||
<link rel="manifest" href="manifest.php">
|
<link rel="manifest" href="manifest.php">
|
||||||
<link rel="search" type="application/opensearchdescription+xml" title="Générer un code QR" href="opensearch.php?redondancy=<?= $_GET['redondancy'] ?>&margin=<?= $_GET['margin'] ?>&size=<?= $_GET['size'] ?>&bgColor=<?= urlencode($_GET['bgColor']) ?>&mainColor=<?= urlencode($_GET['mainColor']) ?>">
|
<link rel="search" type="application/opensearchdescription+xml" title="Générer un code QR" href="opensearch.php?redondancy=<?= $_GET['redondancy'] ?>&margin=<?= $_GET['margin'] ?>&size=<?= $_GET['size'] ?>&bgColor=<?= urlencode($_GET['bgColor']) ?>&mainColor=<?= urlencode($_GET['mainColor']) ?>">
|
||||||
<?php
|
<?php
|
||||||
require "lessphp/lessc.inc.php";
|
|
||||||
$less = new lessc;
|
|
||||||
$less->setVariables($variablesTheme); // Rends ces couleurs utilisables dans style.less
|
|
||||||
|
|
||||||
// If style.min.css exists
|
// If style.min.css exists
|
||||||
if (file_exists("style.min.css"))
|
if (file_exists("style.min.css"))
|
||||||
// And if it's older than the theme config
|
// And if it's older than theme.php or config.inc.php (so not up to date)
|
||||||
if (filemtime("themes/" . $theme . "/theme.php") < filemtime("style.min.css"))
|
if (filemtime("themes/" . $theme . "/theme.php") > filemtime("style.min.css") OR filemtime("config.inc.php") > filemtime("style.min.css"))
|
||||||
// Then delete it
|
// Then delete it
|
||||||
unlink("style.min.css");
|
unlink("style.min.css");
|
||||||
|
|
||||||
// Compile, minimise et met en cache style.less dans style.min.css
|
require "lessphp/lessc.inc.php";
|
||||||
|
$less = new lessc;
|
||||||
|
$less->setVariables($variablesTheme); // Rends ces couleurs utilisables dans style.less
|
||||||
$less->setFormatter("compressed");
|
$less->setFormatter("compressed");
|
||||||
$less->checkedCompile("style.less", "style.min.css");
|
$less->checkedCompile("style.less", "style.min.css"); // Compile, minimise et met en cache style.less dans style.min.css
|
||||||
?>
|
?>
|
||||||
<link type="text/css" rel="stylesheet" href="style.min.css">
|
<link type="text/css" rel="stylesheet" href="style.min.css">
|
||||||
<link type="text/css" rel="stylesheet" href="ubuntu/ubuntu.min.css">
|
<link type="text/css" rel="stylesheet" href="ubuntu/ubuntu.min.css">
|
||||||
|
Loading…
Reference in New Issue
Block a user