} if ($statusCode === 500 && strpos($responseBody, "RoutingMissingException") !== false) { $exception = new RoutingMissingException($exception->getMessage(), $statusCode, $exception); } elseif ($statusCode === 500 && preg_match('/ActionRequestValidationException.+ no documents to get/', $responseBody) === 1) { $exception = new NoDocumentsToGetException($exception->getMessage(), $statusCode, $exception); } elseif ($statusCode === 500 && strpos($responseBody, 'NoShardAvailableActionException') !== false) { $exception = new NoShardAvailableException($exception->getMessage(), $statusCode, $exception); } else { $exception = new ServerErrorResponseException( $this->convertBodyToString($responseBody, $statusCode, $exception), $statusCode ); } $this->logRequestFail($request, $response, $exception); throw $exception; }
if (strpos($body, '"succeeded":true') !== false) { $ignore[] = 404; } $this->process4xxError($request, $response, $ignore); } elseif ($response['status'] >= 500) { $ignore = $request['client']['ignore'] ?? []; $this->process5xxError($request, $response, $ignore); } // No error, deserialize $response['body'] = $this->serializer->deserialize($response['body'], $response['transfer_stats']); } $this->logRequestSuccess($request, $response);
{ if (null === $onFulfilled) { return $this; } try { return resolve($onFulfilled($this->value)); } catch (\Throwable $exception) { return new RejectedPromise($exception); } catch (\Exception $exception) { return new RejectedPromise($exception); } }
public function then( callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null ) { return $this->promise()->then($onFulfilled, $onRejected, $onProgress); } }
FutureArrayInterface $future, callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null ) { return new FutureArray( $future->then($onFulfilled, $onRejected, $onProgress), [$future, 'wait'], [$future, 'cancel'] ); } /**
// No error, deserialize $response['body'] = $this->serializer->deserialize($response['body'], $response['transfer_stats']); } $this->logRequestSuccess($request, $response); return isset($request['client']['verbose']) && $request['client']['verbose'] === true ? $response : $response['body']; } ); return $response; }; }
// RingPHP does not like if client is empty if (empty($request['client'])) { unset($request['client']); } $handler = $this->handler; $future = $handler($request, $this, $transport, $options); return $future; } public function getTransportSchema(): string {
$response = []; $caughtException = null; $this->lastConnection = $connection; $future = $connection->performRequest( $method, $uri, $params, $body, $options, $this );
{ $promise = $this->transport->performRequest( $endpoint->getMethod(), $endpoint->getURI(), $endpoint->getParams(), $endpoint->getBody(), $endpoint->getOptions() ); return $this->transport->resultOrFuture($promise, $endpoint->getOptions()); } }
$endpoint = $endpointBuilder('Search'); $endpoint->setParams($params); $endpoint->setIndex($index); $endpoint->setType($type); $endpoint->setBody($body); return $this->performRequest($endpoint); } /** * Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile. * * $params['index'] = (list) Comma-separated list of data streams, indices, or aliases to search * $params['field'] = (string) Field containing geospatial data to return
public function getApi($params) { $params['index'] = $this->index; return $this->client->get($params); } public function searchApi($params) { return $this->client->search($params); } public function msearchApi($params) { return $this->client->msearch($params); }
'index' => $this->index, 'from' => $_GET['page'] ? ($_GET['page']-1)*$pageSize : 0, 'size' => $pageSize, 'body' => $paramArray, ]; $resp = self::searchApi($params); $pagination = new Pagination([ 'totalCount' => $resp['hits']['total']['value'], 'pageSize' => $pageSize, ]); Yii::$app->params['pagination'] = $pagination;
$elastic = new ElasticController('elastic', 'mod'); $elastic->index = $_SERVER['SERVER_NAME'] . '_' . 'termekek'; if(isset($search)) { $searched = $elastic->searchWithCat(); // Ha első oldalas keresés van } else { $searched = $elastic->actionFilter(); // Ez is elasticos termeklista esetén használandó } $result = ArrayHelper::getColumn($searched, function ($element) { return $element['_source']; }); Yii::$app->params['search_result_total'] = $searched[0]['_score'];
$this->getView()->registerJsFile("@web/js/sj.shop.prod.js"); $this->getView()->registerJsFile("@web/assets/bootstrap/vendors/jqTree/tree.jquery.js"); Url::remember($kategoria, 'lastCategoryId'); //$products = self::loadFilters($kategoria); $products = self::elasticFilters(); // Ez is elasticos termeklista esetén használandó require_once __DIR__ . '/../views/site/replacer.php'; $html = "[shop__category__page]"; $this->getView()->params['modulClass'] = 'shop__category__page'; $html = modulHelyettesito3($html, $kategoria, $products);
$args = $this->controller->bindActionParams($this, $params); Yii::debug('Running action: ' . get_class($this->controller) . '::' . $this->actionMethod . '()', __METHOD__); if (Yii::$app->requestedParams === null) { Yii::$app->requestedParams = $args; } return call_user_func_array([$this->controller, $this->actionMethod], $args); } }
} $result = null; if ($runAction && $this->beforeAction($action)) { // run the action $result = $action->runWithParams($params); $result = $this->afterAction($action, $result); // call afterAction on modules foreach ($modules as $module) { /* @var $module Module */
$parts = $this->createController($route); if (is_array($parts)) { /* @var $controller Controller */ list($controller, $actionID) = $parts; $oldController = Yii::$app->controller; Yii::$app->controller = $controller; $result = $controller->runAction($actionID, $params); if ($oldController !== null) { Yii::$app->controller = $oldController; } return $result; }
$params = $this->catchAll; unset($params[0]); } try { Yii::debug("Route requested: '$route'", __METHOD__); $this->requestedRoute = $route; $result = $this->runAction($route, $params); if ($result instanceof Response) { return $result; } $response = $this->getResponse(); if ($result !== null) {
{ try { $this->state = self::STATE_BEFORE_REQUEST; $this->trigger(self::EVENT_BEFORE_REQUEST); $this->state = self::STATE_HANDLING_REQUEST; $response = $this->handleRequest($this->getRequest()); $this->state = self::STATE_AFTER_REQUEST; $this->trigger(self::EVENT_AFTER_REQUEST); $this->state = self::STATE_SENDING_RESPONSE; $response->send();
$config = yii\helpers\ArrayHelper::merge( require __DIR__ . '/../../common/config/main.php', require __DIR__ . '/../../common/config/main-local.php', require __DIR__ . '/../config/main.php', require __DIR__ . '/../config/main-local.php' ); (new yii\web\Application($config))->run();
$_GET = [ 'kategoria' => '639', 'ProductFilter' => [ 'kat' => [ '639', ], ], ]; $_SESSION = [ '__flash' => [], '__returnUrl' => 'https://pauer-land.hu/?oldal=2&kat=639', 'lastCategoryId' => '639', ];