private function _importCB($m) { $url = $m[1]; $mediaList = preg_replace('/\\s+/', '', $m[2]); if (strpos($url, '://') > 0) { // protocol, leave in place for CSS, comment for JS return self::$_isCss ? $m[0] : "/* Minify_ImportProcessor will not include remote content */"; } if ('/' === $url[0]) { // protocol-relative or root path $url = ltrim($url, '/'); $file = realpath($_SERVER['DOCUMENT_ROOT']) . DIRECTORY_SEPARATOR . strtr($url, '/', DIRECTORY_SEPARATOR); } else { // relative to current path $file = $this->_currentDir . DIRECTORY_SEPARATOR . strtr($url, '/', DIRECTORY_SEPARATOR); } $obj = new Minify_ImportProcessor(dirname($file)); $content = $obj->_getContent($file); if ('' === $content) { // failed. leave in place for CSS, comment for JS return self::$_isCss ? $m[0] : "/* Minify_ImportProcessor could not fetch '{$file}' */"; } return !self::$_isCss || preg_match('@(?:^$|\\ball\\b)@', $mediaList) ? $content : "@media {$mediaList} {\n{$content}\n}\n"; }