JSminifierExtended.php 436 B

123456789101112131415161718
  1. <?php
  2. use MatthiasMullie\Minify\JS;
  3. class JSminifierExtended extends JS {
  4. public function getDataHash() {
  5. return sha1(json_encode($this->accessProtected($this,'data')));
  6. }
  7. private function accessProtected($obj, $prop) {
  8. $reflection = new ReflectionClass($obj);
  9. $property = $reflection->getProperty($prop);
  10. $property->setAccessible(true);
  11. return $property->getValue($obj);
  12. }
  13. }