示例#1
0
 /**
  * @return void
  */
 protected function bundlePackage()
 {
     $this->getBundlerLogger()->logDebug("compressing files to single file");
     $benchmark = new Benchmark();
     $benchmark->start();
     $content = [];
     foreach ($this->getIncludes() as $sourceFile) {
         $sourceFile = realpath($this->getRoot() . '/' . $sourceFile);
         $content[] = file_get_contents($sourceFile);
         $this->getBundlerLogger()->logDebug("- {$sourceFile}");
     }
     $this->compressContent($content);
     $benchmark->stop();
     $this->getBundlerLogger()->logDebug("compressing files to single file in {$benchmark->getTime()} seconds");
 }
示例#2
0
 /**
  * @return void
  */
 protected function bundlePackage()
 {
     $this->getBundlerLogger()->logDebug("compressing files to single file");
     $benchmark = new Benchmark();
     $benchmark->start();
     $fileSystem = new Filesystem();
     $content = [];
     foreach ($this->getIncludes() as $sourceFile) {
         $sourceFile = realpath($this->getRoot() . '/' . $sourceFile);
         $destinationFile = realpath($this->getDestinationMax());
         $path = $fileSystem->makePathRelative(dirname($sourceFile), dirname($destinationFile));
         $path = trim($path, '/');
         $css = file_get_contents($sourceFile);
         $css = $this->changeCssUrls($path, $css);
         $content[] = $css;
         $this->getBundlerLogger()->logDebug('- ' . $sourceFile);
     }
     $this->compressContent($content);
     $benchmark->stop();
     $this->getBundlerLogger()->logDebug("compressing files to single file in {$benchmark->getTime()} seconds");
 }
示例#3
0
 /**
  * @return void
  */
 public function bundle()
 {
     $this->getBundlerLogger()->logInfo($this->getName());
     $benchmark = new Benchmark();
     $benchmark->start();
     $this->preBundle();
     foreach ($this->getPackages() as $package) {
         $package->bundle();
     }
     $this->postBundle();
     $benchmark->stop();
     $this->getBundlerLogger()->logInfo("{$this->getName()} in {$benchmark->getTime()} seconds");
 }
示例#4
0
 /**
  * @return void
  */
 public function bundle()
 {
     $this->getBundlerLogger()->logInfo("bundling package: {$this->getName()}");
     $benchmark = new Benchmark();
     $benchmark->start();
     $this->bundlePackage();
     $benchmark->stop();
     $this->getBundlerLogger()->logInfo("bundling package: {$this->getName()} in {$benchmark->getTime()} seconds");
 }