cache JS-File to reduce response-time

no message
This commit is contained in:
tinect
2019-10-19 23:40:19 +02:00
parent 476502a8b0
commit 3f6a2fc7fa
5 changed files with 58 additions and 4 deletions

View 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);
}
}