Compile the options to a string passable to the command
@return string
166741
public function _compileOptions()
	{
		$compiled = '';

		/**
		 * We'll cycle through the options. If the option has only one 
		 * character, it needs a hash, multiple characters needs two hashes. 
		 */
		foreach( $this->options as $option => $value ) :
			if( strlen($option) > 1 ) $compiled.= "--{$option} {$value} ";
			else $compiled.= "-{$option} {$value}";
		endforeach;

		return $compiled;		
	}
221090
private function OptionsString()
    {
        if (!$this->select->Exists())
        {
            return '';
        }
        $list = new SelectListProvider($this->select);
        $options = $list->ToArray();
        $lines = array();
        foreach ($options as $key=>$value)
        {
            $lines[] = $key . ':' . $value;
        }
        return join("\r\n", $lines);
    }
1319670
public function getCompiled()
    {
        if ($this->compiled === null) {
            $regexp = "/^";

            // Method(s)
            $methodIdx = 0;
            foreach($this->methods as $method) {
                $regexp .= "(?:" . strtoupper($method) . ")";
                if (($methodIdx + 1) < count($this->methods)) {
                    $regexp .= "|";
                }
                $methodIdx++;
            }

            // Separator
            $regexp .= "~";

            // Url
            $regexp .= str_replace('/', '\/', $this->match);

            $regexp .= "$/";

            $this->compiled = $regexp;
        }
        return $this->compiled;
    }
1159158
public function compile()
    {
        $compiled = $this->command;

        // If callable, return the function itself
        if (is_callable($compiled)) {
            return $compiled;
        }

        // Augment with any supplied arguments
        foreach ($this->args as $key => $value) {
            $compiled .= ' ' . escapeshellarg($key);
            if ($value !== null) {
                $compiled .= ' ' . escapeshellarg($value);
            }
        }

        // Add the boilerplate to redirect the output to file/s
        if (count($this->outputTo) > 0) {
            $compiled .= ' | tee ';
            $compiled .= $this->outputMode === 'a' ? '-a ' : '';
            foreach ($this->outputTo as $file) {
                $compiled .= $file . ' ';
            }

            $compiled = trim($compiled);
        }

        // Add boilerplate to remove lockfile after execution
        if ($this->lockFile) {
            $compiled .= '; rm ' . $this->lockFile;
        }

        // Add boilerplate to run in background
        if ($this->canRunInBackground()) {
            // Parentheses are need execute the chain of commands in a subshell
            // that can then run in background
            $compiled = '(' . $compiled . ') > /dev/null 2>&1 &';
        }

        return trim($compiled);
    }
224583
private function formatOptions($options = [], $command = '')
    {
        $dumpOptions = [
            '-h | --help' => "display {$command}command help info",
            '--no-ansi' => "disable ansi output"
        ];

        count($options) > 0 && $dumpOptions = array_merge($dumpOptions, $options);

        $optionsDump = [];
        foreach ($dumpOptions as $name => $desc) {
            $name = Colour::colour($name, Colour::GREEN);
            $this->commandLength > strlen($name) || $this->commandLength = strlen($name) + 3;
            $optionsDump[$name] = $desc;
        }
        return $optionsDump;
    }
1077845
private function _compile() {
		
		// remove spaces
		$this->_result = str_replace('{{ ', '{{', $this->_content);
		$this->_result = str_replace(' }}', '}}', $this->_result);
		
		// check if
		if ($this->ifs) {
			foreach ($this->ifs as $key => $val) {
				$this->_setBool($key, $val);
			}
			empty($this->ifs);
		}
		
		// check loop
		if ($this->loops) {
			foreach ($this->loops as $key => $val) {
				$this->_setArray($key, $val);
			}
			empty($this->loops);
		}
		
		// check static replaces
		if ($this->vars) {
			foreach ($this->vars as $key => $val) {
				$this->_setString($key, $val);
			}
			empty($this->vars);
		}
		
		// include global vars
		if (is_array($this->injects)) {
			foreach ($this->injects as $inject) {
				global $ {
					$inject
				};
			}
			extract($this->injects);
		}
		
		// remove if and loop traces
		$this->_result = preg_replace("/<if\..*?>(.*?)<\/if\..*?>/s", '', $this->_result);
		$this->_result = preg_replace("/<loop\..*?>(.*?)<\/loop\..*?>/s", '', $this->_result);
		
		// check dynamic variables
		$pattern = "\{\{(.*?)\}\}";
		preg_match_all("/" . $pattern . "/", $this->_result, $matches, PREG_SET_ORDER);
		foreach ($matches as $block) {
			$chunk = $block[0];
			$codes = '<?php ' . $this->config['echo'] . '(' . trim($block[1]) . ')' . '; ?>';
			$this->_result = str_replace($chunk, $codes, $this->_result);
		}
		
		// attempt to create cache file for this template in storage directory
		$cache_file = md5($this->_filename) . '.compiled';
		$cache = $this->config['dir_cache'] . '/' . $cache_file;
		$fd = @fopen($cache, 'w+');
		@fwrite($fd, $this->_result);
		@fclose($fd);
		
		// when failed, try to create in /tmp
		if (!file_exists($cache)) {
			$cache = '/tmp/' . $cache_file;
			$fd = @fopen($cache, 'w+');
			@fwrite($fd, $this->_result);
			@fclose($fd);
		}
		
		// if template cache file created then include it, else use eval() to compile
		if (file_exists($cache)) {
			ob_start();
			include $cache;
			$this->_compiled = ob_get_contents();
			ob_end_clean();
			@unlink($cache);
		} else {
			ob_start();
			eval('?>' . $this->_result . '<?php ');
			$this->_compiled = ob_get_contents();
			ob_end_clean();
		}
	}
243655
protected function compileExpression()
    {
        $parts = [$this->getMode()];

        foreach ($this->targetSize as $value) {

            if (is_numeric($value)) {
                $parts[] = (string) $value;
            }
        }

        foreach ($this->arguments as $i => $arg) {

            if (is_numeric($arg) || ($i === 1 and $this->isColor($arg))) {
                $parts[] = trim((string) $arg);
            }
        }

        $source = $this->source;
        $params = implode('/', $parts);
        $filter = $this->compileFilterExpression();

        return compact('source', 'params', 'filter');
    }
738112
public function toString()
	{
		return $this->connection
		            ->prepare($this->buildQuery($this->type))
		            ->bind($this->syntax->getBindings())
		            ->toString();
	}
794532
public function compile() {
		foreach ($this->_params as $key => $value) {
			if (!strpos($key, ':')) {
				continue;
			}
			unset($this->_params[$key]);
			$this->_meta[$key] = $value;
		}

		$this->_match = $this->_params;

		if ($this->_template === '/' || $this->_template === '') {
			$this->_pattern = '@^/*$@';
			return;
		}
		$this->_pattern = "@^{$this->_template}\$@";
		$match = '@([/.])?\{:([^:}]+):?((?:[^{]+?(?:\{[0-9,]+\})?)*?)\}@S';

		if ($this->_config['unicode']) {
			$this->_pattern .= 'u';
		}
		preg_match_all($match, $this->_pattern, $m);

		if (!$tokens = $m[0]) {
			return;
		}
		$slashes = $m[1];
		$params = $m[2];
		$regexs = $m[3];
		unset($m);
		$this->_keys = [];

		foreach ($params as $i => $param) {
			$this->_keys[$param] = $param;
			$this->_pattern = $this->_regex($regexs[$i], $param, $tokens[$i], $slashes[$i]);
		}
		$this->_defaults += array_intersect_key($this->_params, $this->_keys);
		$this->_match = array_diff_key($this->_params, $this->_defaults);
	}
508600
private function compile()
    {
        $options = $replaces = [];
        $pattern = rtrim(ltrim($this->pattern, ':/'), '/');

        // correct [/ first occurrence]
        if (strpos($pattern, '[/') === 0) {
            $pattern = '[' . substr($pattern, 2);
        }

        if (preg_match_all('/<(\w+):?(.*?)?>/', $pattern, $matches)) {
            $variables = array_combine($matches[1], $matches[2]);

            foreach ($variables as $key => $segment) {
                $segment = $this->prepareSegment($key, $segment);
                $replaces["<$key>"] = "(?P<$key>$segment)";
                $options[] = $key;
            }
        }

        $template = preg_replace('/<(\w+):?.*?>/', '<\1>', $pattern);
        $options = array_fill_keys($options, null);

        foreach ($this->constrains as $key => $value) {
            if ($value instanceof Autofill) {
                // only forces value replacement, not required to be presented as parameter
                continue;
            }

            if (!array_key_exists($key, $options)) {
                throw new ConstrainException(sprintf(
                    "Route `%s` does not define routing parameter `<%s>`.",
                    $this->pattern,
                    $key
                ));
            }
        }

        $this->compiled = '/^' . strtr($template, $replaces + self::PATTERN_REPLACES) . '$/iu';
        $this->template = stripslashes(str_replace('?', '', $template));
        $this->options = $options;
    }
88349
public function getOptionParser() {
		$subcommandParser = [
			'options' => [
				/*
				'dry-run'=> array(
					'short' => 'd',
					'help' => 'Dry run the update, no jobs will actually be added.',
					'boolean' => true
				),
				*/
			],
		];
		$subcommandParserFull = $subcommandParser;
		$subcommandParserFull['options']['group'] = [
			'short' => 'g',
			'help' => 'Group (comma separated list possible)',
			'default' => null,
		];
		$subcommandParserFull['options']['type'] = [
			'short' => 't',
			'help' => 'Type (comma separated list possible)',
			'default' => null,
		];

		$rerunParser = $subcommandParser;
		$rerunParser['arguments'] = [
			'type' => [
				'help' => 'Job type. You need to specify one.',
				'required' => true,
			],
			'reference' => [
				'help' => 'Reference.',
				'required' => false,
			],
		];

		return parent::getOptionParser()
			->setDescription($this->_getDescription())
			->addSubcommand('clean', [
				'help' => 'Remove old jobs (cleanup)',
				'parser' => $subcommandParser,
			])
			->addSubcommand('add', [
				'help' => 'Add Job',
				'parser' => $subcommandParser,
			])
			->addSubcommand('stats', [
				'help' => 'Stats',
				'parser' => $subcommandParserFull,
			])
			->addSubcommand('settings', [
				'help' => 'Settings',
				'parser' => $subcommandParserFull,
			])
			->addSubcommand('reset', [
				'help' => 'Manually reset (failed) jobs for re-run.',
				'parser' => $subcommandParserFull,
			])
			->addSubcommand('rerun', [
				'help' => 'Manually rerun (successfully) run job.',
				'parser' => $rerunParser,
			])
			->addSubcommand('hard_reset', [
				'help' => 'Hard reset queue (remove all jobs)',
				'parser' => $subcommandParserFull,
			])
			->addSubcommand('end', [
				'help' => 'Manually end a worker.',
				'parser' => $subcommandParserFull,
			])
			->addSubcommand('kill', [
				'help' => 'Manually kill a worker.',
				'parser' => $subcommandParserFull,
			])
			->addSubcommand('runworker', [
				'help' => 'Run Worker',
				'parser' => $subcommandParserFull,
			]);
	}
1002193
protected function compile()
  {

    $arrData = array();

    $strWhere = " WHERE member=0";
    if (FE_USER_LOGGED_IN)
    {
      $this->import('FrontendUser', 'User');
      $strWhere = " WHERE member=" . $this->User->id;
    }

    if ($this->showWithoutFilter)
    {
      $strWhere = "";
    }


    if ($this->showTracks)
    {
      $objTracks = $this->Database->prepare("SELECT tl_c4g_tracking_tracks.*, CONCAT('track') as type, count(*) as count FROM tl_c4g_tracking_tracks LEFT JOIN tl_c4g_tracking_positions ON tl_c4g_tracking_positions.track_uuid=tl_c4g_tracking_tracks.uuid" . $strWhere . " GROUP BY tl_c4g_tracking_tracks.id")
                                  ->execute();
      if ($objTracks->numRows > 0)
      {
        $arrTracks = $objTracks->fetchAllAssoc();
        $arrData = array_merge($arrData, $arrTracks);
      }
    }
    if ($this->showPois)
    {
      $objPois = $this->Database->prepare("SELECT *, CONCAT('poi') as type FROM tl_c4g_tracking_pois" . $strWhere)
                                  ->execute();
      if ($objPois->numRows > 0)
      {
        $arrPois = $objPois->fetchAllAssoc();
        $arrData = array_merge($arrData, $arrPois);
      }
    }

    uasort($arrData, array($this, 'sortByTstamp'));

    $arrDataManipulatet = array();

    $blnUseEditLink = false;
    if (($objJumpTo = $this->objModel->getRelated('jumpTo')) !== null)
		{
      $blnUseEditLink = true;
      $arrJumpTo = $objJumpTo->row();
		}

    foreach ($arrData as $arrEntry)
    {

      $arrEntry['date'] = \Date::parse(\Date::getNumericDateFormat(),$arrEntry['tstamp']);
      $arrEntry['datim'] = \Date::parse(\Date::getNumericDatimFormat(),$arrEntry['tstamp']);
      if ($blnUseEditLink)
      {
        if ($this->editWithoutFilter || (FE_USER_LOGGED_IN && $this->User->id==$arrEntry['member']))
        {
          $arrEntry['editHref'] = ampersand($this->generateFrontendUrl($arrJumpTo, ((\Config::get('useAutoItem') && !\Config::get('disableAlias')) ?  '/' : '/items/') . $arrEntry['type'] . '_' . $arrEntry['id']));
        }
      }

      //((\Config::get('useAutoItem') && !\Config::get('disableAlias')) ?  '/' : '/items/') . ((!\Config::get('disableAlias') && $objItem->alias != '') ? $objItem->alias : $objItem->id)));

      $arrDataManipulatet[] = $arrEntry;
    }

    //print_r($arrDataManipulatet);
    $this->Template->data = $arrDataManipulatet;

  }
425913
private function compileFilterExpression()
    {
        $filters = [];

        foreach ($this->filters as $filter => $options) {
            $opt = [];

            if (is_array($options)) {

                foreach ($options as $option => $value) {
                    $opt[] = sprintf('%s=%s', $option, $value);
                }
            }
            $filters[] = sprintf('%s;%s', $filter, implode(';', $opt));
        }
        if (!empty($filters)) {
             return sprintf('filter:%s', implode(':', $filters));
        }

        return null;
    }
1125371
public function toString()
    {
        $arguments = $this->getIterator();
        $params = array();
        $optionals = array();
        foreach ($arguments as $argument) {
            if ($argument->isOptional()) {
                $optionals[] = $argument->toString();
            } else {
                $params[] = $argument->toString();
            }
        }

        return implode(', ', array_merge($params, $optionals));
    }
624896
public function options()
    {
        $commandName = $subCommandName = '';
        if (!empty($this->args[0])) {
            $commandName = $this->args[0];
        }
        if (!empty($this->args[1])) {
            $subCommandName = $this->args[1];
        }
        $options = $this->Command->options($commandName, $subCommandName);

        return $this->_output($options);
    }
947402
protected function getOptions()
    {
        $options = [];

        // Here we will gather all of the command line options that have been specified with
        // the double hyphens in front of their name. We will make these available to the
        // Blade task file so they can be used in echo statements and other structures.
        foreach ($_SERVER['argv'] as $argument) {
            if (! starts_with($argument, '--') || in_array($argument, $this->ignoreOptions)) {
                continue;
            }

            $option = explode('=', substr($argument, 2));

            if (count($option) == 1) {
                $option[1] = true;
            }

            $options[$option[0]] = $option[1];
        }

        return $options;
    }
898078
private function getOptionsSearchStrings() {
        if (empty($this->searchStringsCache)) {
            $this->searchStringsCache = array(
                0 => '',
                1 => array(),
            );
            foreach ($this->parameters as $Option) {
                $postfix = self::getPostfix($Option);
                /** @var $Option Option */
                $this->searchStringsCache[0] .= $Option->getShort() . $postfix;
                $this->searchStringsCache[1][] = $Option->getLong() . $postfix;
            }
        }
        return $this->searchStringsCache;
    }