Returns the output of the media generated from the specified input HTML
file

@param  string $input   The input HTML filename or URL
@param  array  $options An array of options for this output only

@return string
332317
public function getOutput($input, array $options = array())
    {
        $this->log(sprintf('Getting output from file (%s)', $input));

        return $this->getGenerator()->getOutput($input, $options);
    }
682965
protected function getOutputMethod($options)
    {
        $outputMethod = 'imagegd';
        if (isset($options['format'])) {
            $outputMethod = 'image' . image_type_to_extension($options['format'], false);
        }
        return $outputMethod;
    }
725748
public static function getMediaInfo($input, $type = null)
    {
        // Just making sure everything goes smooth
        if (substr($input, 0, 2) == '-i') 
        {
            $input = substr($input, 3);
        }

        switch ($type) 
        {
            case 'json':
                $command = self::getProbePath().' -v quiet -print_format json -show_format -show_streams -pretty -i '.$input.' 2>&1';
                $output  = shell_exec($command);
                $output  = json_decode($output, true);
                break;

            case 'xml':
                $command = self::getProbePath().' -v quiet -print_format xml -show_format -show_streams -pretty -i '.$input.' 2>&1';
                $output  = shell_exec($command);
                break;

            case 'csv':
                $command = self::getProbePath().' -v quiet -print_format csv -show_format -show_streams -pretty -i '.$input.' 2>&1';
                $output  = shell_exec($command);
                break;
            
            default:
                $command = self::getProbePath().' -v quiet -print_format json -show_format -show_streams -pretty -i '.$input.' 2>&1';
                $output  = shell_exec($command);
                $output  = json_decode($output, true);
                break;
        }

        return $output;
    }
431171
static function applyOptions(array $input, array $options) {
        $data = array();
        
        foreach($input as $key => $val) {
            if(!isset($options[$key])) {
                continue;
            }
            
            if(\is_array($options[$key])) {
                if(!empty($options[$key]['parse'])) {
                    $call = $options[$key]['parse'];
                    $val = $call($val);
                }
                
                if(!empty($options[$key]['type'])) {
                    $val = self::typecastVariable($val, $options[$key]['type']);
                }
                
                $key = $options[$key]['key'] ?? $key;
            } elseif(!empty($options[$key])) {
                $key = $options[$key];
            }
            
            $data[$key] = $val;
        }
        
        return $data;
    }
661284
public function renderInput(array $options = [])
    {
        $attrs = $this->prepareAttributes();

        if ($this->form && $this->form->getRenderer()) {
            return $this->form->getRenderer()->renderInput($this, $attrs, $options);
        }

        return $this->buildInput($attrs);
    }
1124122
public function output($options = array())
    {
        if (!isset($options["compress"])) $options["compress"] = true;

        $this->_add_page_text();

        if ($options["compress"]) {
            $this->_pdf->set_value("compress", 6);
        } else {
            $this->_pdf->set_value("compress", 0);
        }

        $this->_close();

        if (self::$IN_MEMORY) {
            $data = $this->_pdf->get_buffer();
        } else {
            $data = file_get_contents($this->_file);

            //debugpng
            if ($this->_dompdf->getOptions()->getDebugPng()) {
                print '[pdflib output unlink ' . $this->_file . ']';
            }
            if (!$this->_dompdf->getOptions()->getDebugKeepTemp()) {
                unlink($this->_file);
            }
            $this->_file = null;
            unset($this->_file);
        }

        return $data;
    }
1127834
protected function parseInput($input, array $options = array())
    {
        if ($this->dynamicSettingParser->isDynamicSetting($input)) {
            $parsedSettings = $this->dynamicSettingParser->parseDynamicSetting($input);
            $input = $this->configResolver->getParameter(
                $parsedSettings['param'],
                $parsedSettings['namespace'],
                $parsedSettings['scope']
            );

            if (is_array($input)) {
                $collection = $this->createAssetCollection(array(), $options);
                foreach ($input as $file) {
                    $collection->add(parent::parseInput($file, $options));
                }

                return $collection;
            }
        }

        return parent::parseInput($input, $options);
    }
554777
public function loadHTML( $html, $options = [] ) {
		$html = '<div><!-- pb_fixme -->' . $html . '<!-- pb_fixme --></div>';
		if ( $this->parser instanceof \DOMDocument ) {
			libxml_use_internal_errors( true );
			$this->parser->loadHTML( mb_convert_encoding( $html, 'HTML-ENTITIES', 'UTF-8' ), LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD );
			$this->errors = libxml_get_errors();
			libxml_clear_errors();
			return $this->parser;
		} else {
			return $this->parser->loadHTML( $html, $options );
		}
	}
871588
function output($options = null) {

    // Add page text
    $this->_add_page_text();

    if ( isset($options["compress"]) && $options["compress"] != 1 )
      $this->_pdf->set_value("compress", 0);
    else
      $this->_pdf->set_value("compress", 6);

    $this->_close();

    if ( self::$IN_MEMORY )
      $data = $this->_pdf->get_buffer();

    else {
      $data = file_get_contents($this->_file);

      //debugpng
      if (DEBUGPNG) print '[pdflib output unlink '.$this->_file.']';
      if (!DEBUGKEEPTEMP)

      unlink($this->_file);
      $this->_file = null;
      unset($this->_file);
    }

    return $data;
  }
761556
public function collapse($input)
    {
        $this->inQuotes = false;
        $this->inSingleQuotes = false;
        $this->currentCharacter = false;
        $this->nextCharacter = false;
        $this->lastCharacter = false;
        $this->skipNext = 0;
        $this->lastAdded = 0;
        $this->buildingWord = $this->lastWord = '';

        $initialSize = mb_strlen($input);
        $timeStart = microtime(true);

        $this->input = str_replace(array("\r", "\t"), array('', ' '), trim($input));
        unset($input);

        if (empty($this->input))
        {
            throw new \Exception("No data has been supplied to media collapser.");
        }

        $characterCount = mb_strlen($this->input);

        $output = '';

        for ($i = 0; $i < $characterCount; ++$i)
        {
            if (!empty($this->skipNext)) {
                $this->skipNext--;
                continue;
            }

            $this->currentIndex = $i;
            $character = mb_substr($this->input, $i, 1);
            $this->currentCharacter = ord($character);
            $this->nextCharacter = ($this->currentIndex != $characterCount) ? ord(mb_substr($this->input, $i + 1, 1)) : false;
            $this->lastCharacter = ($this->currentIndex != 0) ? ord(mb_substr($this->input, $i - 1, 1)) : false;

            $methodName = 'handleCharacter' . $this->currentCharacter;

            if (method_exists($this, $methodName))
            {
                $return = $this->$methodName();
            }
            else
            {
                $return = $this->handleCharacter();
            }

            if ($return === false)
            {
                $this->lastWord = $this->buildingWord;
                $this->buildWord = '';
                continue;
            }
            else if ($return === true)
            {
                $output .= $character;
                $this->lastAdded = $this->currentCharacter;

                if (ctype_alpha($character)) {
                    $this->buildingWord .= $character;
                } else {
                    $this->lastWord = $this->buildingWord;
                    $this->buildingWord = '';
                }
            }
            else if (is_string($return))
            {
                $output .= $return;
                $this->lastAdded = ord($output[mb_strlen($output) - 1]);

                $this->lastWord = $this->buildingWord;
                $this->buildingWord = '';
            }
        }

        $this->sizeSavings = ($initialSize - mb_strlen($output));

        if ($this->debug) {
            $output .= "\n" . '/* culled ' . number_format($this->sizeSavings) . ' chars in ' . number_format((microtime(true) - $timeStart) * 1000, 2) . 'ms */';
        }

        return $output;
    }
897458
public function renderMedia(MediaInterface $media, array $options)
    {
        $options = $this->validateOptions($options, __METHOD__);

        return $this->render(
            'OpenOrchestraMediaBundle:RenderMedia:default.html.twig',
            array(
                'media_url' => $this->getFileUrl($media->getFilesystemName()),
                'media_name' => $media->getName(),
                'id' => $options['id'],
                'class' => $options['class'],
                'style' => $options['style']
            )
        );
    }
1179058
protected function encode(array $input)
	{
		// Detect the request content type, default to 'text/plain'
		$content_type = isset($this->headers['Content-Type']) ? $this->headers['Content-Type'] : $this->response_info('content_type', 'text/plain');

		// Get the correct format for the current content type
		$format = \Arr::key_exists(static::$auto_detect_formats, $content_type) ? static::$auto_detect_formats[$content_type] : null;

		switch($format)
		{
			// Format as XML
			case 'xml':
					/**
					 * If the input array has one item in the top level
					 * then use that item as the root XML element.
					 */
					if(count($input) === 1)
					{
						$base_node = key($input);
						return \Format::forge($input[$base_node])->to_xml(null, null, $base_node);
					}
					else
					{
						return \Format::forge($input)->to_xml();
					}
				break;

			// Format as JSON
			case 'json':
					return \Format::forge($input)->to_json();
				break;

			// Format as PHP Serialized Array
			case 'serialize':
					return \Format::forge($input)->to_serialize();
				break;

			// Format as PHP Array
			case 'php':
					return \Format::forge($input)->to_php();
				break;

			// Format as CSV
			case 'csv':
					return \Format::forge($input)->to_csv();
				break;

			// Format as Query String
			default:
					return http_build_query($input, null, '&');
				break;
		}
	}
763652
public function createInputStream($source, array $options = []): InputStream
    {
        if (isset($options['filemode'])) {
            return new FileInputStream($source, $options['filemode']);
        }

        return new FileInputStream($source);
    }
825076
public function getOutputFromView($view, array $parameters = array(),
        array $options = array())
    {
        $this->log(sprintf('Get converted output from view (%s).', $view));

        $html = $this->getTemplatingEngine()->render($view, $parameters);

        return $this->getOutputFromHtml($html, $options);
    }
10973
public function html(array $options = array(), array $ns = array()) {
        if ($ns) {
            foreach ($ns as $key => $url) {
                $this->ns($key, $url);
            }
        }

        return $this->Html->tag('html', null, $this->_namespaces + $options);
    }
222078
public function input($options = array())
    {
        $options = new AnConfig($options);
        $options->append(array(
            'id' => 'person-password',
            'name' => 'password',
            'class' => 'input-block-level',
            'required' => 'required',
            'minlength' => ComPeopleFilterPassword::$MIN_LENGTH,
        ));

        $html = $this->getService('com:base.template.helper.html');

        return $html->passwordfield($options['name'], $options)
                    ->class($options['class'])
                    ->id($options['id'])
                    ->required($options['required'])
                    ->minlength($options['minlength']);
    }
988405
protected static function tagDispatcher($input)
    {
        // textarea, pre, code tags and comments are to be left alone to avoid any non-wanted whitespace inside them so it just outputs them as they were
        if (substr($input[1], 0, 9) == '<textarea' || substr($input[1], 0, 4) == '<pre' || substr($input[1], 0, 5) == '<code' || substr($input[1], 0, 4) == '<!--' || substr($input[1], 0, 9) == '<![CDATA[') {
            return $input[1] . $input[3];
        }
        // closing textarea, code and pre tags and self-closed tags (i.e. <br />) are printed as singleTags because we didn't use openTag for the formers and the latter is a single tag
        if (substr($input[1], 0, 10) == '</textarea' || substr($input[1], 0, 5) == '</pre' || substr($input[1], 0, 6) == '</code' || substr($input[1], - 2) == '/>') {
            return self::singleTag($input[1], $input[3], $input[2]);
        }
        // it's the closing tag
        if ($input[0][1] == '/') {
            return self::closeTag($input[1], $input[3], $input[2]);
        }

        // opening tag
        return self::openTag($input[1], $input[3], $input[2]);
    }