Exemplo n.º 1
0
 /**
  * Tests to see if mangling jquery will not throw an error
  */
 public function testRunningOnJqueryWithMangle()
 {
     $ug = new JSUglify2();
     $output = $ug->uglify([__DIR__ . '/../../../vendor/components/jquery/jquery.js'], self::$buildDir . 'jquery_compressed.min.js', ['compress' => '']);
     $this->assertNotNull($output);
 }
Exemplo n.º 2
0
 private static function setUpFile($md5OfFile, CachingFile $file)
 {
     $ug = new JSUglify2();
     $cachePath = self::$cacheDirectory . self::$JS_CACHE . $md5OfFile . ".js";
     $cachePath = str_replace("\\", "/", $cachePath);
     $cacheUrl = self::$cachePath . self::$JS_CACHE . $md5OfFile . ".js";
     $ug->uglify([$file->getPhysicalPath()], $cachePath, self::getUglifyOptions());
     return ['md5' => $md5OfFile, 'cachePath' => $cachePath, 'cacheUrl' => $cacheUrl];
 }