cache JS-File to reduce response-time
no message
This commit is contained in:
18
data/web/inc/lib/JSminifierExtended.php
Normal file
18
data/web/inc/lib/JSminifierExtended.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
use MatthiasMullie\Minify\JS;
|
||||
|
||||
class JSminifierExtended extends JS {
|
||||
|
||||
public function getDataHash() {
|
||||
return sha1(json_encode($this->accessProtected($this,'data')));
|
||||
}
|
||||
|
||||
private function accessProtected($obj, $prop) {
|
||||
$reflection = new ReflectionClass($obj);
|
||||
$property = $reflection->getProperty($prop);
|
||||
$property->setAccessible(true);
|
||||
return $property->getValue($obj);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user