Verzeichnisstruktur phpBB-3.2.0
- Veröffentlicht
- 06.01.2017
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
Minifier.php
01 <?php
02
03 /*
04 * @package s9e\TextFormatter
05 * @copyright Copyright (c) 2010-2016 The s9e Authors
06 * @license http://www.opensource.org/licenses/mit-license.php The MIT License
07 */
08 namespace s9e\TextFormatter\Configurator\JavaScript;
09 use Exception;
10 abstract class Minifier
11 {
12 public $cacheDir;
13 public $keepGoing = \false;
14 abstract public function minify($src);
15 public function get($src)
16 {
17 try
18 {
19 return (isset($this->cacheDir)) ? $this->getFromCache($src) : $this->minify($src);
20 }
21 catch (Exception $e)
22 {
23 if (!$this->keepGoing)
24 throw $e;
25 }
26 return $src;
27 }
28 public function getCacheDifferentiator()
29 {
30 return '';
31 }
32 protected function getFromCache($src)
33 {
34 $differentiator = $this->getCacheDifferentiator();
35 $key = \sha1(\serialize(array(\get_class($this), $differentiator, $src)));
36 $cacheFile = $this->cacheDir . '/minifier.' . $key . '.js';
37 if (!\file_exists($cacheFile))
38 \file_put_contents($cacheFile, $this->minify($src));
39 return \file_get_contents($cacheFile);
40 }
41 }