if ($connection->isAlive() === true) { return $connection; } if ($this->readyToRevive($connection) === true) { return $connection; } } throw new NoNodesAvailableException("No alive nodes found in your cluster"); } public function scheduleCheck(): void { } private function readyToRevive(Connection $connection): bool { $timeout = min(
/** * Returns a single connection from the connection pool * Potentially performs a sniffing step before returning */ public function getConnection(): ConnectionInterface { return $this->connectionPool->nextConnection(); } /** * Perform a request to the Cluster * * @param string $method HTTP method to use
* * @throws Common\Exceptions\NoNodesAvailableException|\Exception */ public function performRequest(string $method, string $uri, array $params = [], $body = null, array $options = []): FutureArrayInterface { try { $connection = $this->getConnection(); } catch (Exceptions\NoNodesAvailableException $exception) { $this->log->critical('No alive nodes found in cluster'); throw $exception; } $response = [];
$shouldRetry = $transport->shouldRetry($request); $shouldRetryText = ($shouldRetry) ? 'true' : 'false'; $this->log->warning("Retries left? $shouldRetryText"); if ($shouldRetry && !$neverRetry) { return $transport->performRequest( $request['http_method'], $request['uri'], [], $request['body'], $options ); }
{ 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('Get'); $endpoint->setParams($params); $endpoint->setId($id); $endpoint->setIndex($index); $endpoint->setType($type); return $this->performRequest($endpoint); } /** * Returns a script. * * $params['id'] = (string) Script ID * $params['master_timeout'] = (time) Specify timeout for connection to master
public static function getById(int $sectionId): array { $client = EccIndexer::getInstance(); $result = $client->get([ 'index' => self::index(), 'id' => $sectionId ]); return $result['_source'] ?: []; } private function propertyToArray(PropertyDto $property): array
} $arResult['items'] = buildFilter($baseFilter); $arResult['total'] = $total; if ($arParams['SECTION_ID']) { $section = \Ecc\Elastic\ActiveIblockSectionsIndex::getById($arParams['SECTION_ID']); $filterPath = str_replace( [ '#IBLOCK_TYPE_ID#', '#IBLOCK_CODE#', '#SECTION_CODE#',
{ $parentComponentName = ""; $parentComponentPath = ""; $parentComponentTemplate = ""; } return include($_SERVER["DOCUMENT_ROOT"].$this->__path."/component.php"); } /** * Function executes the component. Returns the result of it's execution. * * <p>Note: component must be inited by initComponent method.</p> * @param string $componentTemplate
* * @return mixed * */ public function executeComponent() { return $this->__includeComponent(); } /** * Constructor with ability to copy the component. * * @param CBitrixComponent $component */
{ $component->executeComponent(); $result = $component->arResult; } else { $result = $component->executeComponent(); } $this->__arIncludeAreaIcons = $component->__arIncludeAreaIcons; $frameMode = $component->getFrameMode(); $componentFrame->end();
if (($arParams['AJAX_MODE'] ?? '') == 'Y') { $obAjax = new CComponentAjax($componentName, $componentTemplate, $arParams, $parentComponent); } $this->__componentStack[] = $component; $result = $component->IncludeComponent($componentTemplate, $arParams, $parentComponent, $returnResult); array_pop($this->__componentStack); } if ($bDrawIcons) {
"INSTANT_RELOAD" => "Y", "AJAX_OPTION_JUMP" => $arParams["AJAX_OPTION_JUMP"], "AJAX_OPTION_HISTORY" => $arParams["AJAX_OPTION_HISTORY"], "SECTION_CODE" => "", "SECTION_CODE_PATH" => "" ], false ); ?> </div> <?php $this->EndViewTarget(); ?> <div id="catalog"> <?php $APPLICATION->IncludeComponent(
include($_SERVER["DOCUMENT_ROOT"].$this->__fileAlt); return null; } $templateData = false; include($_SERVER["DOCUMENT_ROOT"].$this->__file); for ($i = count($this->frames) - 1; $i >= 0; $i--) { $frame = $this->frames[$i]; if ($frame->isStarted() && !$frame->isEnded()) {
$parentTemplateFolder, $this ); } else { $result = $this->__IncludePHPTemplate($arResult, $arParams, $parentTemplateFolder); } return $result; } /**
final public function showComponentTemplate() { if (!$this->__bInited) return null; if ($this->__template) $this->__template->includeTemplate($this->arResult); if(is_array($this->arResultCacheKeys)) { $arNewResult = array(); foreach($this->arResultCacheKeys as $key) if(array_key_exists($key, $this->arResult))
{ if (!$this->__bInited) return null; if ($this->initComponentTemplate($templatePage, $this->getSiteTemplateId(), $customTemplatePath)) { $this->showComponentTemplate(); if($this->__component_epilog) $this->includeComponentEpilog($this->__component_epilog); } else { $this->abortResultCache();
break; default: break; } } $this->IncludeComponentTemplate($componentPage);
{ $parentComponentName = ""; $parentComponentPath = ""; $parentComponentTemplate = ""; } return include($_SERVER["DOCUMENT_ROOT"].$this->__path."/component.php"); } /** * Function executes the component. Returns the result of it's execution. * * <p>Note: component must be inited by initComponent method.</p> * @param string $componentTemplate
{ $this->__IncludeComponent(); $result = $this->arResult; } else { $result = $this->__IncludeComponent(); } $frameMode = $this->getFrameMode(); $componentFrame->end(); }
if (($arParams['AJAX_MODE'] ?? '') == 'Y') { $obAjax = new CComponentAjax($componentName, $componentTemplate, $arParams, $parentComponent); } $this->__componentStack[] = $component; $result = $component->IncludeComponent($componentTemplate, $arParams, $parentComponent, $returnResult); array_pop($this->__componentStack); } if ($bDrawIcons) {
"USE_PRICE_COUNT" => "N", "USE_PRODUCT_QUANTITY" => "Y", "USE_REVIEW" => "Y", "USE_SALE_BESTSELLERS" => "Y", "USE_STORE" => "Y", "USE_STORE_PHONE" => "Y", "USE_STORE_SCHEDULE" => "Y" ) );?><br> <?php $APPLICATION->IncludeComponent("ecc:cart.assets",".default"); if ($_REQUEST['debug'] == 'Y') {
else { header($_SERVER["SERVER_PROTOCOL"]." 200 OK"); } $_SERVER["REAL_FILE_PATH"] = $url; include_once($io->GetPhysicalName($_SERVER['DOCUMENT_ROOT'].$url)); die(); } } } //admin section 404
<? include_once($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/include/urlrewrite.php'); if(file_exists($_SERVER['DOCUMENT_ROOT'].'/404.php')) include_once($_SERVER['DOCUMENT_ROOT'].'/404.php'); ?>
$_SESSION = [ 'SESS_AUTH' => [ 'POLICY' => [ 'SESSION_TIMEOUT' => 24, 'SESSION_IP_MASK' => '0.0.0.0', 'MAX_STORE_NUM' => 10, 'STORE_IP_MASK' => '0.0.0.0', 'STORE_TIMEOUT' => 525600, 'CHECKWORD_TIMEOUT' => 2880, 'PASSWORD_LENGTH' => '8', 'PASSWORD_UPPERCASE' => 'Y', 'PASSWORD_LOWERCASE' => 'Y', 'PASSWORD_DIGITS' => 'N', 'PASSWORD_PUNCTUATION' => 'N', 'PASSWORD_CHECK_WEAK' => 'N', 'PASSWORD_CHECK_POLICY' => 'N', 'PASSWORD_CHANGE_DAYS' => 0, 'PASSWORD_UNIQUE_COUNT' => 0, 'LOGIN_ATTEMPTS' => 0, 'BLOCK_LOGIN_ATTEMPTS' => 0, 'BLOCK_TIME' => 0, ], ], 'SESS_IP' => '34.204.181.19', 'SESS_TIME' => 1710853594, 'IS_EXPIRED' => null, 'BX_SESSION_SIGN' => '7a657c0101c5099c32a534cb84606746', 'fixed_session_id' => 'a435bb4ed0a6e70210d8d419cf84c193', 'BITRIX_CONVERSION_CONTEXT_s1' => [ 'ID' => null, 'EXPIRE' => 1710874740, 'UNIQUE' => [], ], 'SESS_SHOW_INCLUDE_TIME_EXEC' => null, 'BX_LOGIN_NEED_CAPTCHA_LOGIN' => [ 'LOGIN' => '', 'POLICY_ATTEMPTS' => 0, ], 'USER_GEO_POSITION' => [ 'locationID' => '47602', 'latitude' => '0.000000', 'longitude' => '0.000000', 'country' => 'Республика Казахстан', 'region' => '', 'city' => 'г.Алматы', 'zoom' => '', ], 'LOCAL_REDIRECTS' => [ 'C' => 0, 'R' => '', ], ];