Configures the user agent information from a user agent string.

@param string $string The user agent string
@param \FlameCore\UserAgent\UserAgentStringParser $parser The parser used to parse the string
320225
public function configureFromUserAgentString($string, UserAgentStringParser $parser = null)
    {
        $parser = $parser ?: new UserAgentStringParser();
        $result = $string !== null ? $parser->parse($string) : $parser->parseFromGlobal();

        $this->setUserAgentString($string);
        $this->fromArray($result);
    }
27267
public function parseString($string, $strict = true) {
        $parser = new ArgumentsParser();
        $matcher = new ArgumentsMatcher($parser);
        $args = $parser->parse($string);
        $args = $parser->group($args);

        return $matcher->matchOption($this, $args, $strict);
    }
495612
public function parse($string, $postprocessing = true)
    {
        return $this->visitString($string, $this->createQueryVisitor(), $postprocessing);
    }
1042392
protected function _isParseable($string) {
        return (
            mb_strpos($string, $this->getConfig('open')) !== false &&
            mb_strpos($string, $this->getConfig('close')) !== false &&
            !$this->getConfig('disabled')
        );
    }
1076115
public function parseString($string)
    {

        $stringHelper = $this->container->get('opifer.content.string_helper');

        $string = $stringHelper->replaceLinks($string);

        return $string;
    }
612283
public function pushParser(Useragent\ParserInterface $parser)
    {
        $this->parser = $parser;
        if ($this->ua) {
            $this->setUA($this->ua);
        }
    }
375931
public function match($userAgentString)
    {
        foreach ($this->getValues() as $userAgentIdentifier) {
            if ($userAgentIdentifier === UserAgentDirective::DEFAULT_USER_AGENT) {
                continue;
            }

            if (substr_count($userAgentString, $userAgentIdentifier)) {
                return $userAgentIdentifier;
            }
        }

        return null;
    }
95801
public function parse($string)
    {
        if (! $this->isSupports($string)) throw new \InvalidArgumentException('invalid string.');

        $define = new OptionDefine();
        preg_match($this->regexp_option, $string, $matches);

        // optional | required
        if ($matches[1] === 'require') $define->required();

        // long-name
        $define->setName($this->pickName($matches[2]));
        
        // short-name
        $define->setShortName($this->pickShortName($matches[2]));

        // defalt value
        $define->setDefault($this->pickValue($define, $matches[2]));
        
        // description
        $define->setDescription($this->pickDescription($matches));

        return $define;
    }
576051
public static function parseString($string, array $values)
    {
        return preg_replace_callback('/#~((.|\r?\n)*?)~#/', function ($matches) use ($values) {
            $match = $matches[1];

            if (isset($values[$match])) {
                return $values[$match];
            }

            // Match is not set in the values, return just the match
            return $match;

        }, $string);
    }
979683
function parseString($html) {
    $this->parser->html = $html;
    $this->parse();
    return $this->output;
  }
1318582
public function init($parts, $parser = LinkUtil::class)
    {

        if (is_string($parts) && filter_var($parts, FILTER_VALIDATE_URL)) {
            $parts = $parser::parse($parts);
        }

        /**@var $Property \ReflectionProperty */
        foreach((new \ReflectionObject($this))->getProperties(\ReflectionProperty::IS_PUBLIC) as $Property) {
            if ((!$Property->getValue($this)) && isset($parts[$Property->getName()])) {
                $Property->setValue($this, $parts[$Property->getName()]);
            }
        }

        return $this;
    }
1305919
public void parse(String string) {
    if (string == null) {
      throw new NullPointerException("string is null");
    }
    int bufferSize = Math.max(MIN_BUFFER_SIZE, Math.min(DEFAULT_BUFFER_SIZE, string.length()));
    try {
      parse(new StringReader(string), bufferSize);
    } catch (IOException exception) {
      // StringReader does not throw IOException
      throw new RuntimeException(exception);
    }
  }
304516
public function disableParser($parser)
    {
        if ($parser instanceof ValueParserInterface) {
            $parser = $parser->getName();
        }

        if (is_string($parser)) {
            $this->disabledParsers[] = $parser;
        }

        return $this;
    }
1311902
protected function parseString(IConfig $config, $string) {
        if ($this->isReference($string)) {
            $value = $config->get($this->parseReferencePath($string));
        } else {
            $value = preg_replace_callback($this->getInterpolationRegexPattern(), function($matches) use ($config) {
                $value = $config->get($matches[1]);

                if ( ! is_scalar($value)) {
                    return $matches[0];
                }

                return $value;
            }, $string);
        }

        return $value;
    }
433263
protected function parseString($string)
    {
        if (!isset($this->config['strict']) || $this->config['strict'] !== false) {
            // Strings are not part of any documented sitemap standard
            return false;
        }
        $array = array_filter(array_map('trim', mb_split('\r\n|\n|\r', $string)));
        foreach ($array as $line) {
            if ($this->isSitemapURL($line)) {
                $this->addArray(self::XML_TAG_SITEMAP, ['loc' => $line]);
                continue;
            }
            $this->addArray(self::XML_TAG_URL, ['loc' => $line]);
        }
        return true;
    }
1115182
public function setUserAgent( $string )
	{
		if( empty( $string ) )
			throw new InvaligArgumentException( 'Must be set' );
		$this->curl->setOption( CURLOPT_USERAGENT, $string );
	}
851455
public function parseUrl($string)
    {
        $engine = null;

        if ($this->databaseIsPath) {
            $engine = substr($string, 0, strpos($string, ':'));
            $string = 'file' . substr($string, strlen($engine));
        }

        parent::parseUrl($string);

        if ($engine !== null) {
            $this->setEngine($engine);
        }
    }