Returns a set of InputControl items defining the values of InputControls

@param string $uri
@return array
507650
public function getInputControlValues($uri)
    {
        $url = $this->service_url . '/reports' . $uri . '/inputControls/values';
        $data = $this->service->prepAndSend($url, array(200), 'GET', null, true, 'application/json', 'application/json');
        $json_obj = json_decode($data);
        $result = array();

        if (empty($json_obj)) {
            return $result;
        }

        foreach ($json_obj->inputControlState as $state) {
            $result[] = InputControlState::createFromJSON($state);
        }
        return $result;
    }
964424
public function setUri($uri)
    {
        if (is_string($uri)) {
            $uri = Zend_Uri::factory($uri);
        }

        if (!$uri instanceof Zend_Uri_Http) {
            /**
 * @see Zend_Http_Client_Exception 
*/
            include_once 'Zend/Http/Client/Exception.php';
            throw new Zend_Http_Client_Exception('Passed parameter is not a valid HTTP URI.');
        }

        // We have no ports, set the defaults
        if (! $uri->getPort()) {
            $uri->setPort(($uri->getScheme() == 'https' ? 443 : 80));
        }

        $this->uri = $uri;

        return $this;
    }
301613
public function getPotentialRules($uri)
    {
        //
        // Try to match uri with rule without route params
        //

        $redirectRules = RedirectRule::where('origin', $uri)->get();

        if ($redirectRules->isNotEmpty()) {
            return $redirectRules;
        }

        //
        // Try to match uri with rule with url params:
        //

        // Search only rules with params but without optional params
        $query = RedirectRule::where('origin', 'LIKE', '%{%')
            ->where('origin', 'NOT LIKE', '%?}%');

        // Narrow potential matches by matching number of url segments
        // (by matching number of slashes)
        $slashesCount = substr_count($uri, '/');
        $rawWhere = \DB::raw("LENGTH(origin) - LENGTH(REPLACE(origin, '/', ''))");
        $query = $query->where($rawWhere, $slashesCount);

        // Ordering
        $query
            // Route with lesser number of parameters will have top priority
            ->orderByRaw("LENGTH(origin) - LENGTH(REPLACE(origin, '{', ''))")
            // Rules with params nearer end of route will have last priority
            ->orderByRaw("INSTR(origin, '{') DESC");

        // Get collection of potential rules
        $potentialRules = $query->get();

        if ($potentialRules->isNotEmpty()) {
            return $potentialRules;
        }

        //
        // Try to match uri with rule with optional url params:
        //

        // Search only rules with optional params
        $query = RedirectRule::where('origin', 'LIKE', '%?}%');

        // Ordering
        $query
            // Route with less segments will have top priority
            ->orderByRaw("LENGTH(origin) - LENGTH(REPLACE(origin, '/', ''))")
            // Route with lesser number of parameters will have next priority
            ->orderByRaw("LENGTH(origin) - LENGTH(REPLACE(origin, '{', ''))")
            // Rules with params nearer end of route will have last priority
            ->orderByRaw("INSTR(origin, '{') DESC");

        return $query->get();
    }
1328703
public function options(string $uri)
    {
        $request = $this->getRequest($uri)
            ->setMethod('OPTIONS');

        return $this->send($request);
    }
270087
public function getControl()
	{
		$items = $this->getPrompt() === FALSE ? array() : array('' => $this->translate($this->getPrompt()));
		$translated = array();
		foreach ($this->items as $key => $value) {
			$translated[$key] = $this->translate($value);
		}
		asort($translated);
		return Helpers::createSelectBox(
			$items + $translated,
			array(
				'selected?' => $this->value,
				'disabled:' => is_array($this->disabled) ? $this->disabled : NULL,
			)
		)->addAttributes(parent::getControl()->attrs);
	}
457719
public function route($uri = null)
    {
        if ($uri === null) {
            $uri = $this->getAppUri();
        }
        //$uri = ltrim(preg_replace('/^([^&]*)&.*$/', '$1', $uri), '/');
        
        $urlElements = parse_url($uri);
        $uri      = isset($urlElements['path'])     ? $urlElements['path']     : '';
        $query    = isset($urlElements['query'])    ? $urlElements['query']    : null;
        $fragment = isset($urlElements['fragment']) ? $urlElements['fragment'] : null;
        $urlTab = explode('/', trim($uri, ' /'));
        $request = Container::getRequest();
        $request->setUri($uri);
        $request->setBaseUrl($this->getBaseUrl());
        $controller = array_shift($urlTab);
        $action = array_shift($urlTab);
        $request->setController($controller ? $controller : self::DEFAULT_CONTROLLER);
        $request->setAction($action ? $action : self::DEFAULT_ACTION);
        while (count($urlTab)) {
            $key = trim(array_shift($urlTab));
            $value = array_shift($urlTab);
            if ($value !== null) {
                $request->setParam($key, $value);
            }
        }
        if ($query !== null) {
            $params = null;
            parse_str($query, $params);
            foreach ($params as $key => $value) {
                $request->setParam($key, $value);
            }
        }
        
        return $this;
    }
82760
private function getUriRegexFromParameters($uri, $params)
    {
        $regex = str_replace('/', '\/', $uri);
        foreach ($params as $param) {
            $regex = str_replace('{' . $param . '}', '([^\/]+)', $regex);
        }
        return $regex;
    }
337154
protected function httpGet($uri)
    {
        $results = [];
        // Start requesting at page 1
        $page = 1;
        $pageSize = 100;
        // We dont know how many pages there are, so assume 1 until we know
        $pagecount = 1;
        while ($page <= $pagecount) {
            //echo('fetching page '.$page.' of '.$pagecount.' current result size is '.count($results).PHP_EOL);
            $this->log[] = [
                        'request' => [
                                    'method' => 'GET',
                                    'uri'    => $uri.'?page='.$page.'&per_page='.$pageSize,
                                    ],
                        ];
            $response = \Httpful\Request::get($uri.'?page='.$page)
                                                    ->basicAuth($this->username, $this->password)
                                                    ->expectsType(\Httpful\Mime::JSON)
                                                    ->parseWith(function ($body) {
                                                        return \Metaclassing\Utility::decodeJson($body);
                                                    })
                                                    ->send()
                                                    ->body;
            $this->log[count($this->log) - 1]['response'] = $response;

            $resultKey = '';
            if (isset($response['zones'])) {
                $resultKey = 'zones';
            }
            if (isset($response['resource_records'])) {
                $resultKey = 'resource_records';
            }
            if (!$resultKey) {
                throw new \Exception('Unhandled results key, check dns client logs for details');
            }
            foreach ($response[$resultKey] as $result) {
                array_push($results, $result);
            }
            // Now that we KNOW the pagecount, update that and increment our page counter
            if (isset($response['total_count'])) {
                $totalResults = $response['total_count'];
                $pagecount = ceil($totalResults / $pageSize);
            }
            // And get the next page ready for the next request
            $page++;
        }

        return $results;
    }
748886
static function headerOverrideArray( $uri )
    {
        $headerArray = array();

        if ( !eZHTTPHeader::enabled() )
        {
            return $headerArray;
        }

        $contentView = false;

        $uriString = eZURLAliasML::cleanURL( $uri->uriString() );

        // If content/view used, get url alias for node
        if ( strpos( $uriString, 'content/view/' ) === 0 )
        {
            $urlParts = explode( '/', $uriString );
            $nodeID = $urlParts[3];
            if ( !$nodeID )
            {
                return $headerArray;
            }

            $node = eZContentObjectTreeNode::fetch( $nodeID );
            if ( !$node )
            {
                return $headerArray;
            }

            $uriString = $node->pathWithNames();
            $contentView = true;
        }
        else
        {
            $uriCopy = clone $uri;
            eZURLAliasML::translate( $uriCopy );
            if ( strpos( $uriCopy->uriString(), 'content/view' ) === 0 )
            {
                $contentView = true;
            }
        }

        $uriString = '/' . eZURLAliasML::cleanURL( $uriString );
        $ini = eZINI::instance();

        foreach( $ini->variable( 'HTTPHeaderSettings', 'HeaderList' ) as $header )
        {
            foreach( $ini->variable( 'HTTPHeaderSettings', $header ) as $path => $value )
            {
                $path = '/' . eZURLAliasML::cleanURL( $path );
                if ( strlen( $path ) == 1 &&
                     ( !$contentView && ( $ini->variable( 'HTTPHeaderSettings', 'OnlyForContent' ) === 'enabled' ) ) &&
                     $uriString != '/' )
                {
                    continue;
                }

                if ( strpos( $uriString, $path ) === 0 )
                {
                    $config = eZStringUtils::explodeStr( $value, ';' );
                    $headerValue = $config[0];
                    $depth = isset( $config[1] ) ? $config[1] : null;
                    $level = isset( $config[2] ) ? $config[2] : null;

                    if ( $header == 'Expires' )
                    {
                        $headerValue = gmdate( 'D, d M Y H:i:s', time() + $headerValue ) . ' GMT';
                    }

                    if ( $depth === null )
                    {
                        $headerArray[$header] = $headerValue;
                    }
                    else
                    {
                        $pathLevel = count( explode( '/', $path ) );
                        $uriLevel = count( explode( '/', $uriString ) );
                        if ( $level === null )
                        {
                            if ( $uriLevel <= $pathLevel + $depth )
                            {
                                $headerArray[$header] = $headerValue;
                            }
                        }
                        else
                        {
                            if ( $uriLevel <= $pathLevel + $depth &&
                                 $uriLevel >= $pathLevel + $level )
                            {
                                $headerArray[$header] = $headerValue;
                            }
                        }
                    }
                }
            }
        }

        return $headerArray;
    }
37013
public function getArguments(string $uri, $callback = null): array
    {
        $values = [];
        $pattern = '/^' . $this->regex . '$/';
        preg_match_all($pattern, $uri, $matches);
        $matchCount = count($matches);
        for ($i = 1; $i < $matchCount; ++$i) {
            $values[] = (!is_null($callback))
                ? (new Callback($callback))->execute($matches[$i][0])
                : $matches[$i][0];
        }
        $arguments = [];
        $i = 0;
        foreach ($this->parameters as $parameter) {
            $arguments[$parameter] = $values[$i];
            ++$i;
        }
        return $arguments;
    }
1283549
public function getGroupControls(string $group): array
    {
        return array_filter($this->controls, function (Control $control) use ($group) {
            return $control->getGroup() === $group;
        });
    }
938358
protected function parseUri(string $uri): array
    {
        $parseAry = \parse_url($uri);

        if (!isset($parseAry['host'], $parseAry['port'], $parseAry['path'], $parseAry['query'])) {
            throw new MysqlException('Uri format error uri=' . $uri);
        }

        $parseAry['database'] = \str_replace('/', '', $parseAry['path']);
        $query                = $parseAry['query'];

        \parse_str($query, $options);

        if (!isset($options['user'], $options['password'])) {
            throw new MysqlException('Lack of username and password，uri=' . $uri);
        }

        if (!isset($options['charset'])) {
            $options['charset'] = '';
        }

        $configs = \array_merge($parseAry, $options);
        unset($configs['path'], $configs['query']);

        return $configs;
    }
696691
public function setUri($uri)
    {
        if (null === $uri) {
            $uri = 'amqp://guest:guest@localhost:5672/';
        }
        $this->uri = parse_url($uri);
        if (($this->uri['scheme'] != 'amqp' && $this->uri['scheme'] != 'amqps')) {
            throw new \UnexpectedValueException(
                sprintf(
                    'a valid URI scheme is request expected format [%s] ' .
                        'received: [%s]', 'tcp://user:pass@host:port/vhost',
                    $uri
                )
            );
        }
        if (empty($this->uri['user']) || empty($this->uri['pass'])) {
            throw new \RuntimeException(
                'AMQPLAIN Auth requires both a user and pass be specified'
            );
        }
        if ($this->uri['scheme'] === 'amqps') {
            if (!extension_loaded('openssl')) {
                throw new \RuntimeException(
                    'SSL connection attempted however openssl extension is not loaded'
                );
            }
            $ssl_context = stream_context_create();
            foreach ($this->options['ssl_options'] as $k => $v) {
                stream_context_set_option($ssl_context, 'ssl', $k, $v);
            }
        }
        return $this;
    }
404304
public function setUri($uri)
    {
        if ($uri instanceof Zend_Uri_Http) {
            // clone the URI in order to keep the passed parameter constant
            $uri = clone $uri;
        } elseif (is_string($uri)) {
            $uri = Zend_Uri::factory($uri);
        }

        if (!$uri instanceof Zend_Uri_Http) {
            /** @see Zend_Http_Client_Exception */

            throw new Zend_Http_Client_Exception('Passed parameter is not a valid HTTP URI.');
        }

        // Set auth if username and password has been specified in the uri
        if ($uri->getUsername() && $uri->getPassword()) {
            $this->setAuth($uri->getUsername(), $uri->getPassword());
        }

        // We have no ports, set the defaults
        if (! $uri->getPort()) {
            $uri->setPort(($uri->getScheme() == 'https' ? 443 : 80));
        }

        $this->uri = $uri;

        return $this;
    }
300133
public function parseUri($uri)
    {
        $ret = [];
        foreach (explode($this->seperators['param'], $uri) as $params) {
            if ($params) {
                @list($key, $values) = explode($this->seperators['key_value'], $params, 2);
                $external = $key;
                if ($internal = $this->translateKeyInput($key)) {
                    $key = $internal;
                }
                $ret[$key] = [];
                foreach (explode($this->seperators['value'], $values) as $value) {
                    if (strlen($value) > 0) {
                        if ($internal = $this->translateValueInput($external, $value)) {
                            $value = $internal;
                        }
                        $ret[$key][] = urldecode($value);
                    }
                }
            }
        }

        return $ret;
    }
368241
public static function extract_query_from_uri($uri)
	{
		$uri_query_str = parse_url($uri, PHP_URL_QUERY);

		if ( ! $uri_query_str)
		{
			return array();
		}

		parse_str($uri_query_str, $uri_query);

		return $uri_query;
	}
534829
public function getReportInputControls($uri)
    {
        $url = $this->service_url . '/reports' . $uri . '/inputControls/values';
        $data = $this->service->prepAndSend($url, array(200, 204), 'GET', null, true, 'application/json', 'application/json');

        $result = array();
        $json_obj = json_decode($data);

        // JRS returns an OK status code with an error message string as the body... so if we cannot parse it into an
        // array, we know that there was an error
        if (empty($json_obj)) {
            return $result;
        }

        foreach ($json_obj->inputControlState as $state) {
            $result[] = \Jaspersoft\Dto\Report\InputControl::createFromJSON($state);
        }
        return $result;
	}