/** * @param string $file * @param string $public * @return string */ public function pack($file, $public) { if (!Packer::isRemote($file) && !is_file($file)) { return sprintf('/* File %s not exists */', $file); } $contents = file_get_contents($file); if ($this->settings['minify']) { $contents = (new CSSmin())->run($contents); } return preg_replace('/(url\\([\'"]?)/', '$1' . $this->settings['asset'] . dirname($public) . '/', $contents); }
/** * @param string $file * @param string $public * @return string */ public function pack($file, $public) { if (!Packer::isRemote($file) && !is_file($file)) { return sprintf('/* File %s not exists */', $file); } $contents = file_get_contents($file); if ($this->settings['minify']) { $contents = JSMin::minify($contents); } return ';' . $contents; }