Run `uglifyjs` against the output and compress it.

@param string $filename Name of the file being generated.
@param string $input The uncompressed contents for $filename.
@return string Compressed contents.
177572
public function output($filename, $input)
    {
        $cmdSep = $this->_settings['version'] <= 1 ? ' - ' : '';
        $cmd = $this->_settings['node'] . ' ' . $this->_settings['uglify'] . $cmdSep . $this->_settings['options'];
        $env = array('NODE_PATH' => $this->_settings['node_path']);
        return $this->_runCmd($cmd, $input, $env);
    }
1267444
protected function uncompress($fileName)
	{
		$fileNameUncompressed = $this->getUncompressedFileName($fileName);
		$command = sprintf('gzip -dc %s > %s', $fileName, $fileNameUncompressed);
		if ($this->console->run($command) !== true)
			$this->line($this->colors->getColoredString("\n".'Uncompress of gzipped file failed.'."\n",'red'));

		return $fileNameUncompressed;
	}
113672
public static function file($input)
    {
        if (Symphony::Log()) {
            Symphony::Log()->pushDeprecateWarningToLog('MD5::file()', 'PBKDF2::hash()', array(
                'message-format' => __('The use of `%s` is strongly discouraged due to severe security flaws.'),
            ));
        }
        return md5_file($input);
    }
945920
protected function compress($filename, $xml)
    {
        if (!$this->compressor) {
            $this->compressor = new ZipFly();
        }

        return $this->compressor->compress($filename, $xml);
    }
495667
public function input($filename, $content)
    {
        $this->_filename = $filename;
        $content = preg_replace_callback($this->_backgroundPattern, array($this, '_replace'), $content);
        $content = preg_replace_callback($this->_backgroundImagePattern, array($this, '_replace'), $content);
        return $content;
    }
422547
public function doIndent($input)
    {
        $subject = $input;

        $output = '';

        $nextLineIndentationLevel = 0;

        do {
            $indentationLevel = $nextLineIndentationLevel;

            $patterns = $this->getTagPatterns();

            $rules = ['NO', 'DECREASE', 'INCREASE', 'DISCARD'];

            $match = [];

            foreach ($patterns as $pattern => $rule) {
                if ($match = preg_match($pattern, $subject, $matches)) {
                    $this->log[] = [
                        'rule' => $rules[$rule],
                        'pattern' => $pattern,
                        'subject' => $subject,
                        'match' => $matches[0],
                    ];

                    $subject = mb_substr($subject, mb_strlen($matches[0]));

                    if ($rule === static::MATCH_DISCARD) {
                        break;
                    }

                    if ($rule === static::MATCH_INDENT_NO) {
                    } else {
                        if ($rule === static::MATCH_INDENT_DECREASE) {
                            $nextLineIndentationLevel--;
                            $indentationLevel--;
                        } else {
                            $nextLineIndentationLevel++;
                        }
                    }

                    if ($indentationLevel < 0) {
                        $indentationLevel = 0;
                    }

                    $output .= str_repeat(
                        $this->options['indentation_character'],
                        $indentationLevel
                    ) . $matches[0] . "\n";

                    break;
                }
            }
        } while ($match);

        $interpretedInput = '';

        foreach ($this->log as $e) {
            $interpretedInput .= $e['match'];
        }

        if ($interpretedInput !== $input) {
            throw new \RuntimeException('Did not reproduce the exact input.');
        }

        $output = preg_replace('/(<(\w+)[^>]*>)\s*(<\/\2>)/', '\\1\\3', $output);

        return $output;
    }
1303211
public function unserialize($input)
    {
        // Unserialize the executable, args, options, data, and inputs.
        list($this->calledScript, $this->args, $this->filter, $this->data, $this->inputs) = unserialize($input);

        $this->filter = $this->filter ?: new NullFilter();
    }
3685
public static function minify($input)
    {
        $output = '';
        $input = self::merge($input);

        $inQuotes        = array();
        $noSpacesAround  = '{}()[]<>|&!?:;,+-*/="\'';

        $input = preg_replace("`(\r\n|\r)`", "\n", $input);
        $inputs = str_split($input);
        $inputs_count = count($inputs);
        $prevChr = null;
        for ($i=0; $i<$inputs_count; $i++) {
            $chr = $inputs[$i];
            $nextChr = $i+1 < $inputs_count ? $inputs[$i+1] : null;

            switch ($chr) {
                case '/':
                    if (!count($inQuotes) && $nextChr == '*' && $inputs[$i+2] != '@') {
                        $i = 1 + strpos($input, '*/', $i);
                        continue 2;
                    } elseif (!count($inQuotes) && $nextChr == '/') {
                        if (strpos($input, "\n", $i)) {
                            $i = strpos($input, "\n", $i);
                        } else {
                            $i = strlen($input);
                        }
                        continue 2;
                    } elseif (!count($inQuotes)) {
                        $eolPos = strpos($input, "\n", $i);
                        if ($eolPos===false) {
                            $eolPos = $inputs_count;
                        }
                        $eol = substr($input, $i, $eolPos-$i);
                        if (!preg_match('`^(/.+(?<=\\\/)/(?!/)[gim]*)[^gim]`U', $eol, $m)) {
                            preg_match('`^(/.+(?<!/)/(?!/)[gim]*)[^gim]`U', $eol, $m);
                        }
                        // it's a RegExp
                        if (isset($m[1])) {
                            $output .= $m[1];
                            $i += strlen($m[1])-1;
                            continue 2;
                        }
                    }
                    break;

                case "'":
                case '"':
                    if ($prevChr != '\\' || ($prevChr == '\\' && $inputs[$i-2] == '\\')) {
                        if (end($inQuotes) == $chr) {
                            array_pop($inQuotes);
                        } elseif (!count($inQuotes)) {
                            $inQuotes[] = $chr;
                        }
                    }
                    break;

                case ' ':
                case "\t":
                case "\n":
                    if (!count($inQuotes)) {
                        if (strstr("{$noSpacesAround} \t\n", $nextChr)
                            || strstr("{$noSpacesAround} \t\n", $prevChr)
                        ) {
                            continue 2;
                        }
                        $chr = ' ';
                    }
                    break;

                default:
                    break;
            }

            $output .= $chr;
            $prevChr = $chr;
        }
        $output = trim($output);
        $output = str_replace(';}', '}', $output);

        return $output;
    }
128740
public function unserialize($input)
    {
        $htmlCleaner = unserialize($input);

        $this->htmlCleaner = $htmlCleaner;

        $this->loadDefaultHandlers();
    }
846323
public static function file($input)
    {
        if (Symphony::Log()) {
            Symphony::Log()->pushDeprecateWarningToLog('SHA1::file()', 'PBKDF2::hash()', array(
                'message-format' => __('The use of `%s` is strongly discouraged due to severe security flaws.'),
            ));
        }
        return sha1_file($input);
    }
403189
protected function _generateScript($file, $filename, $input)
    {
        $id = str_replace($this->_settings['ext'], '', basename($filename));
        $filepath = str_replace($this->_settings['ext'], '', $filename);

        foreach ($this->_settings['paths'] as $path) {
            $path = rtrim($path, '/') . '/';
            if (strpos($filepath, $path) === 0) {
                $filepath = str_replace($path, '', $filepath);
            }
        }

        $config = [
            'asString' => true,
        ];

        $text = <<<JS
var hogan = require('hogan.js'),
    util = require('util');

try {
    var template = hogan.compile(%s, %s);
    util.print('\\nwindow.JST["%s"] = window.JST["%s"] = ' + template + ';');
    process.exit(0);
} catch (e) {
    console.error(e);
    process.exit(1);
}
JS;
        $contents = sprintf(
            $text,
            json_encode($input),
            json_encode($config),
            $id,
            $filepath
        );
        file_put_contents($file, $contents);
    }
899091
public function compile($input, $filename = null)
    {
        $this->flags = 0;

        if ($filename === null) {
            $filename = file_exists($input) ? $input : null;
            $input = $filename === null ? $input : file_get_contents($filename);
        }

        $start = '';
        $end = '';
        if (preg_match('/^([)}\]\s]*)(.*?)([({\[\s]*)$/', trim($input), $match)) {
            list(, $start, $input, $end) = $match;
        }

        $parser = new Parser($this, $input, $filename);
        $compiler = new Compiler($this);
        $block = $parser->parse();
        $php = $compiler->compile($block);

        if ($this->hasFlag(self::FLAG_TRUNCATED_PARENTHESES)) {
            $php = preg_replace('/\)[\s;]*$/', '', $php);
        }

        if (mb_substr(ltrim($end), 0, 1) === '{') {
            $php = preg_replace('/\s*\{\s*\}\s*$/', '', $php);
        }

        $dependencies = $compiler->getDependencies();
        if ($this->getOption('catchDependencies')) {
            $this->dependencies = array_unique(array_merge($this->dependencies, $dependencies));
            $dependencies = [];
        }

        $php = $compiler->compileDependencies($dependencies) . $start . $php . $end;

        return preg_replace('/\{(\s*\}\s*\{)+$/', '{', $php);
    }
518559
public function input($filename, $input)
    {
        if (substr($filename, strlen($this->_settings['ext']) * -1) !== $this->_settings['ext']) {
            return $input;
        }

        $tmpFile = tempnam(TMP, 'TYPESCRIPT');
        $cmd = $this->_settings['typescript'] . " " . escapeshellarg($filename) . " --out " . $tmpFile;
        $this->_runCmd($cmd, null);
        $output = file_get_contents($tmpFile);
        unlink($tmpFile);
        return $output;
    }
1030956
public function displayFile($input, array $vars = [])
    {
        if ($this->getDefaultOption('pugjs')) {
            echo $this->renderFile($input, $vars);

            return;
        }

        parent::displayFile($input, $vars);
    }
723079
protected function handleFileDelete(array $input = [])
    {
        if (array_key_exists(Field::FILE_DELETE_FLAG, $input)) {
            $input[Field::FILE_DELETE_FLAG] = $input['key'];
            unset($input['key']);
        }

        Input::replace($input);

        return $input;
    }
592375
public function markdownFilter($input, $parserName = 'default')
    {
        $parser = $this->parserCollection->getParser($parserName);

        return $parser->parse($input);
    }
1187242
public function renderWithPhp($input, array $vars, $filename = null)
    {
        return parent::render($input, $vars, $filename);
    }