mirror of
https://github.com/voc/streaming-website
synced 2024-11-10 06:34:17 +00:00
use local-file cache
This commit is contained in:
parent
d9d8d4a497
commit
d0e4536faf
1 changed files with 9 additions and 3 deletions
12
index.php
12
index.php
|
@ -68,13 +68,19 @@ try {
|
|||
|
||||
else if($route == 'assets/css/main.css')
|
||||
{
|
||||
$parser = new Less_Parser([
|
||||
$dir = forceslash(sys_get_temp_dir());
|
||||
|
||||
$css_file = Less_Cache::Get([
|
||||
'assets/css/main.less' => forceslash(baseurl()).'assets/css/',
|
||||
], [
|
||||
'sourceMap' => true,
|
||||
'compress' => true,
|
||||
'relativeUrls' => true,
|
||||
|
||||
'cache_dir' => $dir,
|
||||
]);
|
||||
$parser->parseFile('assets/css/main.less', forceslash(baseurl()).'assets/css/');
|
||||
$css = $parser->getCss();
|
||||
|
||||
$css = file_get_contents($dir.$css_file);
|
||||
header('Content-Type: text/css');
|
||||
header('Content-Length: '.strlen($css));
|
||||
print($css);
|
||||
|
|
Loading…
Reference in a new issue