Compresses a string.

@param string $content The content to compress
@param string $type    The type of content, either "js" or "css"
@param array  $options An indexed array of additional options

@return string The compressed content
183008
protected function compress($content, $type, $options = array())
    {
        $pb = $this->createProcessBuilder(array($this->javaPath));

        if (null !== $this->stackSize) {
            $pb->add('-Xss'.$this->stackSize);
        }

        $pb->add('-jar')->add($this->jarPath);

        foreach ($options as $option) {
            $pb->add($option);
        }

        if (null !== $this->charset) {
            $pb->add('--charset')->add($this->charset);
        }

        if (null !== $this->lineBreak) {
            $pb->add('--line-break')->add($this->lineBreak);
        }

        // input and output files
        $tempDir = FilesystemUtils::getTemporaryDirectory();
        $input = tempnam($tempDir, 'assetic_yui_input');
        $output = tempnam($tempDir, 'assetic_yui_output');
        file_put_contents($input, $content);
        $pb->add('-o')->add($output)->add('--type')->add($type)->add($input);

        $proc = $pb->getProcess();
        $code = $proc->run();
        unlink($input);

        if (0 !== $code) {
            if (file_exists($output)) {
                unlink($output);
            }

            throw FilterException::fromProcess($proc)->setInput($content);
        }

        if (!file_exists($output)) {
            throw new \RuntimeException('Error creating output file.');
        }

        $retval = file_get_contents($output);
        unlink($output);

        return $retval;
    }
1045181
protected function minifyContent($type, $content)
    {
        $minifier = null;
        if ($type === AssetManager::CSS) {
            $minifier = new \MatthiasMullie\Minify\CSS($content);
        } else if ($type === AssetManager::JS) {
            $minifier = new \MatthiasMullie\Minify\JS($content);
        }
        
        if ($minifier !== null) {
            return $minifier->minify();
        }
        
        return $content;
    }
432291
public function template($type, $options) {
		if (isset($options[$type])) {
			return $options[$type];
		}
		return isset($options['template']) ? $options['template'] : '';
	}
464465
protected function renderNumberWidget($content, array $options = [])
    {
        $options = array_merge([
            'precision' => 2,
            'append' => '',
        ], $options);

        return $this->renderBlock('show_widget_simple', [
            'content' => trim(sprintf('%s %s', number_format($content, $options['precision'], ',', ' '), $options['append']))
        ]);
    }
234758
public function deserialize($data, $content = null, array $options = [])
    {
        if ('text/html' === $data['type'] || 'text/plain' === $data['type']) {
            // HTML is directly stored in the choice entity
            $content->setData($data['data']);
            $content->setResourceNode(null);
        } else {
            // Other types require a ResourceNode
            $node = $this->resourceContentSerializer->deserialize($content);

            $content->setData('');
            $content->setResourceNode($node);
        }

        return $content;
    }
1365430
public function tableCell($content, array $options = [])
    {
        return $this->formatTemplate('tablecell', [
            'attrs' => $this->templater()->formatAttributes($options),
            'content' => $content
        ]);
    }
1155412
public function transform($content, $options = [])
    {
        if (!$content instanceof \DateInterval) {
            return 0;
        }

        $decTime = 0;
        $decTime += ($content->d ? $content->d * 60 * 24 : 0);
        $decTime += ($content->h ? $content->h * 60 : 0);
        $decTime += $content->i;
        $decTime += ($content->s ? $content->s / 60 : 0);

        return $decTime;
    }
1062445
protected function encode($content)
    {
        $jsonString = parent::encode($content);

        if ($this->hasValidCallback()) {
            return \sprintf('%s(%s);', $this->getCallback(), $jsonString);
        }

        return $jsonString;
    }
1284384
protected function _handleFlash($type, $options) {
		if (isset($options[$type . 'Message']) && $options[$type . 'Message'] !== false) {
			if (is_string($options[$type . 'Message'])) {
				$flashOptions = [];
				if (isset($options[$type . 'FlashOptions'])) {
					$flashOptions = $options[$type . 'FlashOptions'];
				}

				if (!isset($flashOptions['element'])) {
					if (!$this->_registry->has('Flash')) {
						$this->_registry->load('Flash');
					}

					$flashOptions['element'] = $type;
					$this->_registry->get('Flash')->set($options[$type . 'Message'], $flashOptions);
				}

				return true;
			}
		}

		return false;
	}
134657
protected function _compile($content, $type = self::TPL_COMPILE_ALL) {
        switch ($type) {
            case self::TPL_COMPILE_ALL:
                return $this->_parser->parse($content);
                break;

            case self::TPL_COMPILE_INCLUDE:
                return $this->_parser->parseNoTemplate($content);
                break;

            case self::TPL_COMPILE_LANG:
                return $this->_parser->parseLang($content);
                break;
        }

        return '';
    }
418087
public function alert($content, $type = 'success', $options = [])
    {
        if (!is_array($content)) {
            $content = [
                'body' => $content,
            ];
        }

        $content = array_merge($content, [
            'options' => $options,
        ]);

        $this->session->getFlashBag()->add($type, $content);
    }
310506
public function send($content = null, $type = null) 
    {
        if (!is_null($content)) {
            $this->setContents(is_array($content) ? $content : array($content));
        }
        if (!is_null($type)) {
            $this->setContentType($type);
        }
        return parent::send();
    }
1326778
public function fileContent($content)
    {
        if (is_resource($this->fileContent)) {
            fclose($this->fileContent);
        }

        $this->fileContent = $content;

        if (is_resource($content) && empty($this->fileType)) {
            $this->fileType($this->getTypeFromResource($content));
        }

        return $this;
    }
163758
public function fromString($value, $type, array $options)
    {
        return $this->convert($value, $type, $options, $this->getFromStringCallbacks());
    }
600850
public function transform($content, $options = [])
    {
        if (!$content) {
            return $content;
        }

        return self::TRANSFORM_PREFIX . md5((string) $content);
    }
1243323
public static function prepare( $type, $options ) {

		self::field_loader( $type );

		$prepare = '%s';

		if ( method_exists( self::$loaded[ $type ], 'prepare' ) ) {
			$prepare = self::$loaded[ $type ]->prepare( $options );
		}

		$prepare = apply_filters( "pods_field_{$type}_prepare", $prepare, $options, $type );

		return $prepare;
	}
831584
public static function purify($content, array $options = [])
    {
        $config = HTMLPurifier_Config::createDefault();

        foreach ($options as $key => $value) {
            $config->set($key, $value);
        }

        if (!file_exists($config->get('Cache.SerializerPath'))) {
            mkdir($config->get('Cache.SerializerPath'));
        }

        $purifier = new HTMLPurifier($config);

        return $purifier->purify($content);
    }