Convierte respuesta del método buscar en formato oficial de ruta.

@param $valor
@param int $estado_http

@return Ruta
166795
private function prepararRuta($valor, $estado_http = null)
    {
        // Instanciamos ruta
        $ruta = new Ruta();

        if (is_int($valor)) {
            $ruta->tipo = 'estado_http';
            $ruta->estadoHttp = $valor;
        }

        if (is_int($valor['accion'])) {
            $ruta->tipo = 'estado_http';
            $ruta->estadoHttp = $valor['accion'];
        }


        // Verificamos si el valor representa a una vista
        if (strpos($valor['accion'], '#') === 0) {
            $ruta->tipo = 'vista';
            $ruta->accion = substr($valor['accion'], 1);
            $ruta->estadoHttp = $valor['estado_http'];
        }

        // Verificamos si el valor representa a una redirección
        if (strpos($valor['accion'], '=') === 0) {
            $ruta->tipo = 'redir';
            $ruta->accion = substr($valor['accion'], 1);
            if ($valor['estado_http'] == 303) {
                $ruta->estadoHttp = 303;
            } else {
                $ruta->estadoHttp = 302;
            }
        }

        // Verificamos si el valor representa un llamado a controlador
        if (strpos($valor['accion'], '@') !== false) {
            $ruta->tipo = 'llamado';
            $ruta->estadoHttp = $valor['estado_http'];
            $ruta->accion = $valor['accion'];

            if (isset($valor['parametros'])) {
                $ruta->parametros = $valor['parametros'];
            }
        }

        if (isset($estado_http)) {
            $ruta->estadoHttp = $estado_http;
        }

        return $ruta;
    }
1323821
public static function request(String $name = NULL, $value = NULL)
    {
        return self::_method($name, $value, $_REQUEST, __FUNCTION__);
    }
1189221
public function setHeader($header, $value = null)
    {
        if (is_string($header)) {
            $this->headers[$header] = $value;
        }

        return $this;
    }
896349
static function httpCharset()
    {
        $realCharset =& $GLOBALS['eZTextCodecHTTPCharsetReal'];
        if ( !isset( $realCharset ) )
        {
            $charset = '';
            if ( isset( $GLOBALS['eZTextCodecHTTPCharset'] ) )
                $charset = $GLOBALS['eZTextCodecHTTPCharset'];
            if ( $charset == '' )
            {
                if ( isset( $GLOBALS['eZTextCodecInternalCharsetReal'] ) )
                    $realCharset = $GLOBALS['eZTextCodecInternalCharsetReal'];
                else
                    $realCharset = eZTextCodec::internalCharset();
            }
            else
            {
                $realCharset = eZCharsetInfo::realCharsetCode( $charset );
            }
        }
        return $realCharset;
    }
611508
public function getHttpTransport()
	{
		// lazy load a default if one has not be set
		if ($this->_httpTransport === false)
		{
			require_once(dirname(__FILE__) . '/HttpTransport/FileGetContents.php');

			$this->_httpTransport = new Apache_Solr_HttpTransport_FileGetContents();
		}

		return $this->_httpTransport;
	}
1330637
public static function FILTER_SANITIZE_HTTP_URL($value)
	{
		if( !preg_match('/^http/i', $value)){
			$value = 'http://'.$value;
		}
		$value =  filter_var($value, FILTER_VALIDATE_URL);
		
		return $value?:null;	
	}
1091743
function initTransaction($buyOrder, $sessionId, $urlReturn, $urlFinal, $stores) {

        try {
            $error = array();

            $wsInitTransactionInput = new wsInitTransactionInput();

            $detailArray = array();

            $wsInitTransactionInput->wSTransactionType = "TR_MALL_WS";
            $wsInitTransactionInput->commerceId = $this->config->getCommerceCode();
            $wsInitTransactionInput->sessionId = $sessionId;
            $wsInitTransactionInput->buyOrder = $buyOrder;

            $wsInitTransactionInput->returnURL = $urlReturn;
            $wsInitTransactionInput->finalURL = $urlFinal;

            $cont = 0;
            foreach ($stores as $value) {

                $wsTransactionDetail = new wsTransactionDetail();
                $wsTransactionDetail->commerceCode = $value["storeCode"];
                $wsTransactionDetail->buyOrder = floatval($value["buyOrder"]);
                $wsTransactionDetail->amount = $value["amount"];

                $detailArray[$cont] = $wsTransactionDetail;
                $cont++;

            }

            $wsInitTransactionInput->transactionDetails = $detailArray;


            $initTransactionResponse = $this->_initTransaction(
                    array("wsInitTransactionInput" => $wsInitTransactionInput)
            );

            /** Validación de firma del requerimiento de respuesta enviado por Webpay */
            $xmlResponse = $this->soapClient->__getLastResponse();
            $soapValidation = new SoapValidation($xmlResponse, $this->config->getWebpayCert());
            $validationResult = $soapValidation->getValidationResult();

            /** Valida conexion a Webpay. Caso correcto retorna URL y Token */
            if ($validationResult === TRUE) {

                $wsInitTransactionOutput = $initTransactionResponse->return;
                return $wsInitTransactionOutput;

            } else {

                $error["error"] = "Error validando conexi&oacute;n a Webpay (Verificar que la informaci&oacute;n del certificado sea correcta)";
                $error["detail"] = "No se pudo completar la conexi&oacute;n con Webpay";
            }
        } catch (\Exception $e) {

            $error["error"] = "Error conectando a Webpay (Verificar que la informaci&oacute;n del certificado sea correcta)";

            $replaceArray = array('<!--' => '', '-->' => '');
            $error["detail"] = str_replace(array_keys($replaceArray), array_values($replaceArray), $e->getMessage());
        }

        return $error;
    }
1186584
public function setHttpMethod($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Scheduler\V1beta1\HttpMethod::class);
        $this->http_method = $var;

        return $this;
    }
1209372
public function getByProjectId($value, $limit = 1000, $useConnection = 'read')
    {
        if (is_null($value)) {
            throw new HttpException('Value passed to ' . __FUNCTION__ . ' cannot be null.');
        }


        $query = 'SELECT * FROM `build` WHERE `project_id` = :project_id LIMIT :limit';
        $stmt = Database::getConnection($useConnection)->prepare($query);
        $stmt->bindValue(':project_id', $value);
        $stmt->bindValue(':limit', (int)$limit, \PDO::PARAM_INT);

        if ($stmt->execute()) {
            $res = $stmt->fetchAll(\PDO::FETCH_ASSOC);

            $map = function ($item) {
                return new Build($item);
            };
            $rtn = array_map($map, $res);

            $count = count($rtn);

            return array('items' => $rtn, 'count' => $count);
        } else {
            return array('items' => array(), 'count' => 0);
        }
    }
454265
protected function receiveTokenFieldValueFromRequest($value = null)
    {
        $requestQueryParameter = $this->getRequest()->getQueryParams();
        $requestBody           = $this->getRequest()->getParsedBody();
        $fieldname             = $this->getFieldnameToken();

        if (true === isset($requestQueryParameter[$fieldname])) {
            $value = $requestQueryParameter[$fieldname];
        } elseif (true === isset($requestBody[$fieldname])) {
            $value = $requestBody[$fieldname];
        }

        return $value;
    }
585549
protected function sendRequest($endpoint, $httpMethod, Payload $payload = null)
    {
        return $this->requestHandler->sendRequest($endpoint, $httpMethod, $payload);
    }
311898
public function parameter(string $name, $value): HttpRequest
    {
        $this->parameters[$name] = $value;

        return $this;
    }
372394
public function Protocol($Value = NULL) {
      if (!is_null($Value) && in_array($Value, array('http', 'https')))
         $this->_Protocol = $Value;
         
      return $this->_Protocol;
   }
687256
public static function replaceHttpsUrls($value){

		// CDN resources
		$value = str_ireplace('http://cdn.prtl.eu', '//cdn.prtl.eu', $value);
		$value = str_ireplace('http://cdn2.prtl.eu', '//cdn2.prtl.eu', $value);
		$value = str_ireplace('http://studyportals-cdn2.imgix.net', '//studyportals-cdn2.imgix.net', $value);

		// Portal urls
		$value = str_ireplace('http://www.admissiontestportal.com', 'https://www.admissiontestportal.com', $value);
		$value = str_ireplace('http://www.preparationcoursesportal.com', 'https://www.preparationcoursesportal.com', $value);

		return $value; //NOSONAR
	}
628876
static function json($data = NULL, $httpCode = 200, $headers = NULL)
	{
		if ($data instanceof HTTP_Exception_Redirect) {
			throw $data;
		}

		$response = Kohana_Response::factory();
		try {
			$response->headers([
				'cache-control' => 'no-cache, no-store, max-age=0, must-revalidate',
				'content-type' => 'application/json; charset=utf-8',
			]);
			if (Kohana_Arr::is_array($headers)) $response->headers($headers);

			$response->status($httpCode);
		} catch (Exception $e) {
			$response->status($httpCode = 500);
			$data = $e;
		}

		if ($data instanceof Exception) {
			if ($data instanceof HTTP_Exception) {
				$response->status($httpCode = $data->getCode());
			} elseif ($httpCode < 400) {
				$response->status($httpCode = 500);
			}
			$data = Helpers_Exception::toArray($data);
		}

		if (NULL === $data && $httpCode == 200) {
			$response->status(204);
		} elseif (NULL !== $data) {
			try {
				$response->body(json_encode($data, JSON_UNESCAPED_UNICODE));
			} catch (Exception $e) {
				$response->body(json_encode(Helpers_Exception::toArray($e), JSON_UNESCAPED_UNICODE), 500);
			}
		}

		$response->send_headers(TRUE);

		exit($response);
	}
510920
public function setHeader($field, $value)
    {
        if (!$field = @trim($field)) {
            throw new HTTPException(
                'Non-empty string field name required at Argument 1'
            );
        }

        $ucField = strtoupper($field);

        if ($ucField === 'SET-COOKIE') {
            $this->setCookieFromRawHeaderValue($value);

            return $this;
        } elseif (is_scalar($value) || is_null($value)) {
            $value = [(string) $value];
        } elseif (!(is_array($value) && $this->isValidArrayHeader($value))) {
            throw new HTTPException(
                'Invalid header; scalar or one-dimensional array of scalars required'
            );
        }

        if (isset($this->ucHeaders[$ucField])) {
            // There's already a case-insensitive match for this field name. Reuse the
            // existing case mapping.
            $field = $this->ucHeaders[$ucField];
        }

        $this->headers[$field] = $value;
        $this->ucHeaders[$ucField] = $field;

        return $this;
    }
175370
public function make($name, $value, $minute = null, $path = "/", $domain = null, $secure = null, $httpOnly = true)
    {
        $this->toString = $value;
        if ($minute === 0) {
            $timez = 0;
        } else {
            $timez = time() + ($minute * 60);
        }
        if ($secure===null and isset($_SERVER['HTTPS'])) {
            $secure = true;
        }
        if ($domain===null) {
            $domain = Configer::getCookieDefaultDomain();
        }
        $this->func        = function ($value) use ($name, $timez, $path, $domain, $secure, $httpOnly) {
            setcookie($name, $value, $timez, $path, $domain, $secure, $httpOnly);
        };
        return new InputUtilities($this->toString, $this->func);
    }