diff --git a/cache/cache_scss.php b/cache/cache_scss.php index 2d30e70..d2058f7 100644 --- a/cache/cache_scss.php +++ b/cache/cache_scss.php @@ -10,9 +10,9 @@ class cache_scss { return sha1($file.';'.filemtime($file)); } public static function url($file){ - if(!\SYSTEM\CACHE\cache_scss::get($file)){ + if(!\SYSTEM\CACHE\cache_scss::get($file->SERVERPATH())){ \LIB\lib_scssphp::php(); - \SYSTEM\CACHE\cache_scss::put($file, (new \Leafo\ScssPhp\Compiler())->compile(file_get_contents($file)));} - return './api.php?call=cache&id='.self::CACHE_SCSS.'&ident='.self::ident($file); + \SYSTEM\CACHE\cache_scss::put($file->SERVERPATH(), (new \Leafo\ScssPhp\Compiler())->compile(file_get_contents($file->SERVERPATH())));} + return './api.php?call=cache&id='.self::CACHE_SCSS.'&ident='.self::ident($file->SERVERPATH()); } } \ No newline at end of file diff --git a/page/State.php b/page/State.php index 4789166..7c6aa50 100644 --- a/page/State.php +++ b/page/State.php @@ -31,12 +31,12 @@ class State { $row['css'] = $row['js'] = array(); if(\class_exists($row['php_class']) && \method_exists($row['php_class'], 'css') && \is_callable($row['php_class'].'::css')){ $row['css'] = array_merge($row['css'], \call_user_func($row['php_class'].'::css'));} + $row['css'] = count($row['css']) > 0 ? array(\SYSTEM\CACHE\cache_css::url($row['css'])) : array(); if(\class_exists($row['php_class']) && \method_exists($row['php_class'], 'scss') && \is_callable($row['php_class'].'::scss')){ $scss = \call_user_func($row['php_class'].'::scss'); foreach($scss as $s){ $row['css'][] = \SYSTEM\CACHE\cache_scss::url($s);} } - $row['css'] = count($row['css']) > 0 ? array(\SYSTEM\CACHE\cache_css::url($row['css'])) : array(); if(\class_exists($row['php_class']) && \method_exists($row['php_class'], 'js') && \is_callable($row['php_class'].'::js')){ $row['js'] = array_merge($row['js'], \call_user_func($row['php_class'].'::js'));} $row['js'] = count($row['js']) > 0 ? array(\SYSTEM\CACHE\cache_js::url($row['js'])) : array();