_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
83
13k
language
stringclasses
1 value
meta_information
dict
q243800
MopDescription.loadPaymentSupplementaryData
validation
protected function loadPaymentSupplementaryData(MopInfo $options) { foreach ($options->paySupData as $paySupData) { $this->paymentModule->paymentSupplementaryData[] = new PaymentSupplementaryData( $paySupData->function, $paySupData->data ); } ...
php
{ "resource": "" }
q243801
MopDescription.checkAndCreateMopDetailedData
validation
private function checkAndCreateMopDetailedData($fopType) { if (is_null($this->paymentModule->mopDetailedData)) { $this->paymentModule->mopDetailedData = new MopDetailedData($fopType); } }
php
{ "resource": "" }
q243802
OfficeIdentification.loadSpecificChanges
validation
public function loadSpecificChanges($changeTicketing, $changeQueueing, $changeOptQueueEl) { if ($changeTicketing) { $this->specificChanges[] = new SpecificChanges( SpecificChanges::ACTION_TICKETING_OFFICE ); } if ($changeQueueing) { $this->...
php
{ "resource": "" }
q243803
Search.loadGeoCode
validation
protected function loadGeoCode(PointOfRefSearchOptions $params) { if ($this->checkAllNotEmpty($params->latitude, $params->longitude)) { $this->porFndQryParams->geoCode = new GeoCode( $params->longitude, $params->latitude ); } }
php
{ "resource": "" }
q243804
Search.loadBusinessId
validation
protected function loadBusinessId(PointOfRefSearchOptions $params) { if ($this->checkAnyNotEmpty($params->businessCategory, $params->businessForeignKey)) { $this->porFndQryParams->businessId = new BusinessId( $params->businessCategory, $params->businessForeignKey ...
php
{ "resource": "" }
q243805
SomewhatRandomGenerator.generateSomewhatRandomString
validation
public static function generateSomewhatRandomString($length = 22) { $chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz"; srand((double) microtime() * 1000000); $i = 0; $somewhatRandom = ''; while ($i < $length) { $num = rand() % 60; ...
php
{ "resource": "" }
q243806
HandlerDisplayHistory.analyze
validation
public function analyze(SendResult $response) { $analyzeResponse = new Result($response); $domXpath = $this->makeDomXpath($response->responseXml); $queryAllErrorCodes = "//m:generalErrorGroup//m:errorNumber/m:errorDetails/m:errorCode"; $queryAllErrorMsg = "//m:generalErrorGroup/m:g...
php
{ "resource": "" }
q243807
WsMessageUtility.checkAnyNotEmpty
validation
protected function checkAnyNotEmpty() { $foundNotEmpty = false; $args = func_get_args(); foreach ($args as $arg) { if (!empty($arg)) { $foundNotEmpty = true; break; } } return $foundNotEmpty; }
php
{ "resource": "" }
q243808
WsMessageUtility.checkAllNotEmpty
validation
protected function checkAllNotEmpty() { $foundEmpty = false; $args = func_get_args(); foreach ($args as $arg) { if (empty($arg)) { $foundEmpty = true; break; } } return !$foundEmpty; }
php
{ "resource": "" }
q243809
WsMessageUtility.checkAllIntegers
validation
protected function checkAllIntegers() { $foundNonInt = false; $args = func_get_args(); foreach ($args as $arg) { if (!is_int($arg)) { $foundNonInt = true; break; } } return !$foundNonInt; }
php
{ "resource": "" }
q243810
WsMessageUtility.checkAnyTrue
validation
protected function checkAnyTrue() { $foundTrue = false; $args = func_get_args(); foreach ($args as $arg) { if ($arg === true) { $foundTrue = true; break; } } return $foundTrue; }
php
{ "resource": "" }
q243811
HandlerFactory.loadNonceBase
validation
protected static function loadNonceBase($handlerParams) { if (empty($handlerParams->authParams->nonceBase)) { $handlerParams->authParams->nonceBase = SomewhatRandomGenerator::generateSomewhatRandomString(); } return $handlerParams; }
php
{ "resource": "" }
q243812
Fop.isValidFopType
validation
public static function isValidFopType($fopType) { return ($fopType == self::IDENT_CASH || $fopType == self::IDENT_CHECK || $fopType == self::IDENT_CREDITCARD || $fopType == self::IDENT_MISC); }
php
{ "resource": "" }
q243813
Params.loadSessionHandler
validation
protected function loadSessionHandler($params) { if (isset($params['sessionHandler']) && $params['sessionHandler'] instanceof Session\Handler\HandlerInterface) { $this->sessionHandler = $params['sessionHandler']; } }
php
{ "resource": "" }
q243814
Params.loadAuthParams
validation
protected function loadAuthParams($params) { if (isset($params['authParams'])) { if ($params['authParams'] instanceof AuthParams) { $this->authParams = $params['authParams']; } elseif (is_array($params['authParams'])) { $this->authParams = new AuthPara...
php
{ "resource": "" }
q243815
Params.loadSessionHandlerParams
validation
protected function loadSessionHandlerParams($params) { if (isset($params['sessionHandlerParams'])) { if ($params['sessionHandlerParams'] instanceof SessionHandlerParams) { $this->sessionHandlerParams = $params['sessionHandlerParams']; } elseif (is_array($params['sessi...
php
{ "resource": "" }
q243816
Params.loadRequestCreatorParams
validation
protected function loadRequestCreatorParams($params) { if (isset($params['requestCreatorParams'])) { if ($params['requestCreatorParams'] instanceof RequestCreatorParams) { $this->requestCreatorParams = $params['requestCreatorParams']; } elseif (is_array($params['reque...
php
{ "resource": "" }
q243817
RepricePnrWithBookingClass.mergeOptions
validation
protected function mergeOptions($existingOptions, $newOptions) { if (!empty($newOptions)) { $existingOptions = array_merge( $existingOptions, $newOptions ); } return $existingOptions; }
php
{ "resource": "" }
q243818
RepricePnrWithBookingClass.hasPricingOption
validation
protected function hasPricingOption($optionKey, $priceOptions) { $found = false; foreach ($priceOptions as $pog) { if ($pog->pricingOptionKey->pricingOptionKey === $optionKey) { $found = true; } } return $found; }
php
{ "resource": "" }
q243819
AirAuxItinerary.loadArnk
validation
protected function loadArnk(Segment\ArrivalUnknown $segment) { $this->travelProduct = new TravelProduct(); $this->travelProduct->productDetails = new ProductDetails($segment->identification); $this->messageAction = new MessageAction(Business::FUNC_ARNK); }
php
{ "resource": "" }
q243820
MasterPricerTravelBoardSearch.loadCustomerRefs
validation
protected function loadCustomerRefs($dkNumber) { if (!is_null($dkNumber)) { $this->customerRef = new MasterPricer\CustomerRef(); $this->customerRef->customerReferences[] = new MasterPricer\CustomerReferences( $dkNumber, MasterPricer\CustomerReferences:...
php
{ "resource": "" }
q243821
SessionHandlerParams.loadWsdl
validation
protected function loadWsdl($params) { if (isset($params['wsdl'])) { if (is_string($params['wsdl'])) { $this->wsdl = [ $params['wsdl'] ]; } elseif (is_array($params['wsdl'])) { $this->wsdl = $params['wsdl']; ...
php
{ "resource": "" }
q243822
SessionHandlerParams.loadOverrideSoapClient
validation
protected function loadOverrideSoapClient($params) { if (isset($params['overrideSoapClient']) && $params['overrideSoapClient'] instanceof \SoapClient) { $this->overrideSoapClient = $params['overrideSoapClient']; } if (isset($params['overrideSoapClientWsdlName'])) { $t...
php
{ "resource": "" }
q243823
SessionHandlerParams.loadTransactionFlowLink
validation
protected function loadTransactionFlowLink($params) { if (isset($params['enableTransactionFlowLink']) && $params['enableTransactionFlowLink'] === true) { $this->enableTransactionFlowLink = true; $this->consumerId = (isset($params['consumerId'])) ? $params['consumerId'] : null; ...
php
{ "resource": "" }
q243824
SoapHeader2.prepareForNextMessage
validation
protected function prepareForNextMessage($messageName, $messageOptions) { if (!$this->isAuthenticated && $messageName !== 'Security_Authenticate') { throw new InvalidSessionException('No active session'); } $this->getSoapClient($messageName)->__setSoapHeaders(null); if ...
php
{ "resource": "" }
q243825
HandlerNameChange.analyze
validation
public function analyze(SendResult $response) { $analyzeResponse = new Result($response); $domXpath = $this->makeDomXpath($response->responseXml); $qPassErrors = "//m:passengerErrorInEnhancedData//m:errorDetails/m:errorCode"; $qPassErrorCat = "//m:passengerErrorInEnhancedData//m:er...
php
{ "resource": "" }
q243826
DisplayTST.loadReferences
validation
protected function loadReferences($params) { if ($this->checkAnyNotEmpty($params->passengers, $params->segments)) { $this->psaInformation = new PsaInformation(); foreach ($params->passengers as $passenger) { $this->psaInformation->refDetails[] = new RefDetails($passe...
php
{ "resource": "" }
q243827
AddMultiElements.loadBare
validation
protected function loadBare(PnrAddMultiElementsOptions $params) { $tattooCounter = 0; if (!is_null($params->actionCode)) { $this->pnrActions = new AddMultiElements\PnrActions( $params->actionCode ); } if (!is_null($params->recordLocator)) { ...
php
{ "resource": "" }
q243828
AddMultiElements.loadCreatePnr
validation
protected function loadCreatePnr(PnrCreatePnrOptions $params) { $this->pnrActions = new AddMultiElements\PnrActions( $params->actionCode ); $tattooCounter = 0; if ($params->travellerGroup !== null) { $this->addTravellerGroup($params->travellerGroup); ...
php
{ "resource": "" }
q243829
AddMultiElements.addItineraries
validation
protected function addItineraries($itineraries, $legacySegments, &$tattooCounter) { if (!empty($legacySegments)) { $this->addSegments($legacySegments, $tattooCounter); } foreach ($itineraries as $itinerary) { $this->addSegments( $itinerary->segments, ...
php
{ "resource": "" }
q243830
AddMultiElements.addReceivedFrom
validation
protected function addReceivedFrom($explicitRf, $doAutoAdd, $defaultRf, &$tattooCounter) { if ($this->dataElementsMaster === null) { $this->dataElementsMaster = new DataElementsMaster(); } if (!empty($explicitRf) || ($doAutoAdd && !empty($defaultRf))) { //Set a recei...
php
{ "resource": "" }
q243831
FlightDate.setArrivalDate
validation
public function setArrivalDate(\DateTime $arrivalDate) { $this->arrivalDate = ($arrivalDate->format('dmy') !== '000000') ? $arrivalDate->format('dmy') : null; $time = $arrivalDate->format('Hi'); if ($time !== '0000') { $this->arrivalTime = $time; } }
php
{ "resource": "" }
q243832
PaymentModule.loadPaymentData
validation
public function loadPaymentData(MopInfo $options) { if ($this->checkAnyNotEmpty( $options->payMerchant, $options->transactionDate, $options->payments, $options->installmentsInfo, $options->fraudScreening, $options->payIds )) { ...
php
{ "resource": "" }
q243833
Factory.createRequestCreator
validation
public static function createRequestCreator($params, $libIdentifier) { $params->receivedFrom = self::makeReceivedFrom( $params->receivedFrom, $libIdentifier ); $theRequestCreator = new Base($params); return $theRequestCreator; }
php
{ "resource": "" }
q243834
FareOptions.loadFeeIds
validation
protected function loadFeeIds($feeIds) { if (is_null($this->feeIdDescription)) { $this->feeIdDescription = new FeeIdDescription(); } foreach ($feeIds as $feeId) { $this->feeIdDescription->feeId[] = new FeeId($feeId->type, $feeId->number); } }
php
{ "resource": "" }
q243835
FareOptions.loadCurrencyOverride
validation
protected function loadCurrencyOverride($currency) { if (is_string($currency) && strlen($currency) === 3) { $this->addPriceType(PricingTicketing::PRICETYPE_OVERRIDE_CURRENCY_CONVERSION); $this->conversionRate = new ConversionRate($currency); } }
php
{ "resource": "" }
q243836
HandlerRetrieveSeatMap.findMessage
validation
public static function findMessage($code) { $message = null; if (array_key_exists($code, self::$errorList)) { $message = self::$errorList[$code]; } return $message; }
php
{ "resource": "" }
q243837
HandlerRetrieveSeatMap.decodeProcessingLevel
validation
public static function decodeProcessingLevel($level) { $decoded = null; $map = [ 0 => 'system', 1 => 'application' ]; if (array_key_exists($level, $map)) { $decoded = $map[$level]; } return $decoded; }
php
{ "resource": "" }
q243838
AbstractLexer.isNextTokenAny
validation
public function isNextTokenAny(array $tokens) { return null !== $this->lookahead && in_array($this->lookahead['type'], $tokens, true); }
php
{ "resource": "" }
q243839
AbstractLexer.moveNext
validation
public function moveNext() { $this->peek = 0; $this->token = $this->lookahead; $this->lookahead = (isset($this->tokens[$this->position])) ? $this->tokens[$this->position++] : null; return $this->lookahead !== null; }
php
{ "resource": "" }
q243840
AbstractLexer.skipUntil
validation
public function skipUntil($type) { while ($this->lookahead !== null && $this->lookahead['type'] !== $type) { $this->moveNext(); } }
php
{ "resource": "" }
q243841
AbstractLexer.peek
validation
public function peek() { if (isset($this->tokens[$this->position + $this->peek])) { return $this->tokens[$this->position + $this->peek++]; } else { return null; } }
php
{ "resource": "" }
q243842
AbstractLexer.getLiteral
validation
public function getLiteral($token) { $className = get_class($this); $reflClass = new \ReflectionClass($className); $constants = $reflClass->getConstants(); foreach ($constants as $name => $value) { if ($value === $token) { return $className . '::' . $name...
php
{ "resource": "" }
q243843
CheckAuthDictionary.execute
validation
public function execute() { $result = $this->resultJsonFactory->create(); try { $activeVersion = $this->getRequest()->getParam('active_version'); $dictionaryName = Config::AUTH_DICTIONARY_NAME; $dictionary = $this->api->getSingleDictionary($activeVersion, $dictio...
php
{ "resource": "" }
q243844
CheckSuSetting.execute
validation
public function execute() { $result = $this->resultJsonFactory->create(); try { $service = $this->api->checkServiceDetails(); $currActiveVersion = $this->vcl->getCurrentVersion($service->versions); $dictionaryName = Config::CONFIG_DICTIONARY_NAME; $di...
php
{ "resource": "" }
q243845
WafAllowlist.execute
validation
public function execute() { $result = $this->resultJson->create(); try { $activeVersion = $this->getRequest()->getParam('active_version'); $activateVcl = $this->getRequest()->getParam('activate_flag'); $service = $this->api->checkServiceDetails(); $thi...
php
{ "resource": "" }
q243846
ResponsePlugin.aroundSetHeader
validation
public function aroundSetHeader(Http $subject, callable $proceed, ...$args) // @codingStandardsIgnoreLine - unused parameter { // Is Fastly cache enabled? if ($this->config->getType() !== Config::FASTLY) { return $proceed(...$args); } // Is current header X-Magento-Tags ...
php
{ "resource": "" }
q243847
Delete.execute
validation
public function execute() { $result = $this->resultJson->create(); try { $aclId = $this->getRequest()->getParam('acl_id'); $aclItemId = $this->getRequest()->getParam('acl_item_id'); $deleteItem = $this->api->deleteAclItem($aclId, $aclItemId); if (!$...
php
{ "resource": "" }
q243848
ListAll.execute
validation
public function execute() { $result = $this->resultJson->create(); try { $activeVersion = $this->getRequest()->getParam('active_version'); $ioOptions = $this->api->getImageOptimizationDefaultConfigOptions($activeVersion)->data->attributes; if (!$ioOptions) { ...
php
{ "resource": "" }
q243849
Vcl.getCurrentVersion
validation
public function getCurrentVersion(array $versions) { if (!empty($versions)) { foreach ($versions as $version) { if ($version->active) { return $activeVersion = $version->number; } } } throw new LocalizedException(__...
php
{ "resource": "" }
q243850
Vcl.getNextVersion
validation
public function getNextVersion(array $versions) { if (isset(end($versions)->number)) { return (int) end($versions)->number + 1; } throw new LocalizedException(__('Error fetching next version.')); }
php
{ "resource": "" }
q243851
Vcl.determineVersions
validation
public function determineVersions(array $versions) { $activeVersion = null; $nextVersion = null; if (!empty($versions)) { foreach ($versions as $version) { if ($version->active) { $activeVersion = $version->number; } ...
php
{ "resource": "" }
q243852
Vcl.getActiveVersion
validation
public function getActiveVersion($service, $activeVersion) { $currActiveVersion = $this->determineVersions($service->versions); if ($currActiveVersion['active_version'] != $activeVersion) { throw new LocalizedException(__('Active versions mismatch.')); } return $currActiv...
php
{ "resource": "" }
q243853
Create.execute
validation
public function execute() { $result = $this->resultJson->create(); try { $activeVersion = $this->getRequest()->getParam('active_version'); $dictionary = $this->api->getAuthDictionary($activeVersion); if ((is_array($dictionary) && empty($dictionary)) || !isset($...
php
{ "resource": "" }
q243854
Statistic.prepareGAReqData
validation
private function prepareGAReqData() { if (!empty($this->GAReqData)) { return $this->GAReqData; } $mandatoryReqData = []; $mandatoryReqData['v'] = 1; // Tracking ID $mandatoryReqData['tid'] = $this->getGATrackingId(); $cid = $this->config->getCID()...
php
{ "resource": "" }
q243855
Statistic.getWebsiteName
validation
public function getWebsiteName() { $websites = $this->storeManager->getWebsites(); $websiteName = 'Not set.'; foreach ($websites as $website) { if ($website->getIsDefault()) { $websiteName = $website->getName(); } } return $websiteNa...
php
{ "resource": "" }
q243856
Statistic.isApiKeyValid
validation
public function isApiKeyValid() { try { $apiKey = $this->scopeConfig->getValue(Config::XML_FASTLY_API_KEY); $serviceId = $this->scopeConfig->getValue(Config::XML_FASTLY_SERVICE_ID); $isApiKeyValid = $this->api->checkServiceDetails(true, $serviceId, $apiKey); } cat...
php
{ "resource": "" }
q243857
Statistic.prepareCustomVariables
validation
private function prepareCustomVariables() { if ($this->validationServiceId != null) { $serviceId = $this->validationServiceId; } else { $serviceId = $this->scopeConfig->getValue(Config::XML_FASTLY_SERVICE_ID); } $customVars = [ // Service ID ...
php
{ "resource": "" }
q243858
Statistic.getCountry
validation
public function getCountry() { $countryCode = $this->scopeConfig->getValue('general/country/default'); if (!$countryCode) { return null; } $country = $this->countryFactory->create()->loadByCode($countryCode); return $country->getName(); }
php
{ "resource": "" }
q243859
Statistic.getSiteLocation
validation
public function getSiteLocation() { $countryId = $this->scopeConfig->getValue('general/store_information/country_id'); if ($countryId) { $country = $this->countryFactory->create()->loadByCode($countryId); $countryName = $country->getName(); } else { $count...
php
{ "resource": "" }
q243860
Statistic.generateCid
validation
public function generateCid() { return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x', /* 32 bits for time_low */ mt_rand(0, 0xffff), mt_rand(0, 0xffff), /* 16 bits for time_mid */ mt_rand(0, 0xffff), /* 16 bits for time_hi...
php
{ "resource": "" }
q243861
Statistic.sendInstalledReq
validation
public function sendInstalledReq() { $pageViewParams = [ 'dl' => self::GA_PAGEVIEW_URL . self::FASTLY_INSTALLED_FLAG, 'dh' => preg_replace('#^https?://#', '', rtrim(self::GA_PAGEVIEW_URL, '/')), 'dp' => '/'.self::FASTLY_INSTALLED_FLAG, 'dt' => ...
php
{ "resource": "" }
q243862
Statistic.sendValidationRequest
validation
public function sendValidationRequest($validatedFlag, $serviceId = null) { if ($serviceId != null) { $this->validationServiceId = $serviceId; } if ($validatedFlag) { $validationState = self::FASTLY_VALIDATED_FLAG; } else { $validationState = self:...
php
{ "resource": "" }
q243863
Statistic.sendConfigurationRequest
validation
public function sendConfigurationRequest($configuredFlag) { if ($configuredFlag) { $configuredState = self::FASTLY_CONFIGURED_FLAG; } else { $configuredState = self::FASTLY_NOT_CONFIGURED_FLAG; } $pageViewParams = [ 'dl' => self::GA_PAGEVIEW_U...
php
{ "resource": "" }
q243864
Statistic.daysFromInstallation
validation
public function daysFromInstallation() { $stat = $this->statisticRepository->getStatByAction(self::FASTLY_INSTALLED_FLAG); if (!$stat->getCreatedAt()) { return null; } $installDate = date_create($stat->getCreatedAt()); $currentDate = date_create($this->dateTime->...
php
{ "resource": "" }
q243865
Statistic.sendReqToGA
validation
private function sendReqToGA($body = '', $method = \Zend_Http_Client::POST, $uri = self::GA_API_ENDPOINT) { $reqGAData = (array)$this->getGAReqData(); if ($body != '' && is_array($body) && !empty($body)) { $body = array_merge($reqGAData, $body); } try { $cli...
php
{ "resource": "" }
q243866
GetAction._toHtml
validation
protected function _toHtml() // @codingStandardsIgnoreLine - required by parent class { if ($this->config->isGeoIpEnabled() == false || $this->config->isFastlyEnabled() == false) { return parent::_toHtml(); } /** @var string $actionUrl */ $actionUrl = $this->getUrl('fast...
php
{ "resource": "" }
q243867
Acl._construct
validation
protected function _construct() // @codingStandardsIgnoreLine - required by parent class { $this->addColumn('backend_name', ['label' => __('Name')]); $this->_addAfter = false; $this->_template = 'Fastly_Cdn::system/config/form/field/acl.phtml'; parent::_construct(); }
php
{ "resource": "" }
q243868
Acl.renderCellTemplate
validation
public function renderCellTemplate($columnName) { if ($columnName == 'store_id' && isset($this->_columns[$columnName])) { $options = $this->getOptions(__('-- Select Store --')); $element = $this->elementFactory->create('select'); $element->setForm( $this->...
php
{ "resource": "" }
q243869
Acl.getOptions
validation
protected function getOptions($label = false) // @codingStandardsIgnoreLine - required by parent class { $options = []; foreach ($this->_storeManager->getStores() as $store) { $options[] = [ 'value' => $store->getId(), 'label' => $store->getName() ...
php
{ "resource": "" }
q243870
Delete.execute
validation
public function execute() { $result = $this->resultJson->create(); try { $dictionaryId = $this->getRequest()->getParam('dictionary_id'); $key = $this->getRequest()->getParam('item_key'); if ($key == '') { return $result->setData(['status' => true...
php
{ "resource": "" }
q243871
Create.execute
validation
public function execute() { $result = $this->resultJson->create(); try { $aclId = $this->getRequest()->getParam('acl_id'); $value = $this->getRequest()->getParam('item_value'); $comment = $this->getRequest()->getParam('comment_value'); $negated = 0; ...
php
{ "resource": "" }
q243872
GetCustomSnippets.execute
validation
public function execute() { $result = $this->resultJson->create(); try { $read = $this->filesystem->getDirectoryRead(DirectoryList::VAR_DIR); $snippetPath = $read->getRelativePath('vcl_snippets_custom'); $customSnippets = $read->read($snippetPath); i...
php
{ "resource": "" }
q243873
PurgeCache.sendPurgeRequest
validation
public function sendPurgeRequest($pattern = '') { if (empty($pattern)) { if ($this->config->canPreserveStatic()) { $result = $this->api->cleanBySurrogateKey(['text']); } else { $result = $this->api->cleanAll(); } } elseif (!is_array...
php
{ "resource": "" }
q243874
Historic.execute
validation
public function execute() { $output = $this->layoutFactory->create() ->createBlock('Fastly\Cdn\Block\Dashboard\Tab\Stats\Historic') ->toHtml(); $resultRaw = $this->resultRawFactory->create(); return $resultRaw->setContents($output); }
php
{ "resource": "" }
q243875
DeleteCustomSnippet.execute
validation
public function execute() { $result = $this->resultJson->create(); try { $activeVersion = $this->getRequest()->getParam('active_version'); $snippet = $this->getRequest()->getParam('snippet_id'); $activateVcl = $this->getRequest()->getParam('activate_flag'); ...
php
{ "resource": "" }
q243876
Notification.checkUpdate
validation
public function checkUpdate($currentVersion = null) { $lastVersion = $this->getLastVersion(); if (!$lastVersion || version_compare($lastVersion, $currentVersion, '<=')) { return; } $versionPath = Config::XML_FASTLY_LAST_CHECKED_ISSUED_VERSION; $oldValue = $this-...
php
{ "resource": "" }
q243877
Notification.getLastVersion
validation
public function getLastVersion() { try { $url = self::CHECK_VERSION_URL; $client = $this->curlFactory->create(); $client->write(\Zend_Http_Client::GET, $url, '1.1'); $responseBody = $client->read(); $client->close(); $responseCode = \...
php
{ "resource": "" }
q243878
Create.execute
validation
public function execute() { $result = $this->resultJson->create(); try { $dictionaryId = $this->getRequest()->getParam('dictionary_id'); $value = $this->getRequest()->getParam('item_value'); $key = $this->getRequest()->getParam('item_key'); $this->api...
php
{ "resource": "" }
q243879
ListAll.execute
validation
public function execute() { $result = $this->resultJson->create(); try { $aclId = $this->getRequest()->getParam('acl_id'); $aclItems = $this->api->aclItemsList($aclId); if (is_array($aclItems) && empty($aclItems)) { return $result->setData([ ...
php
{ "resource": "" }
q243880
StructurePlugin.aroundGetElementByPathParts
validation
public function aroundGetElementByPathParts(\Closure $proceed, array $pathParts) { /** @var Section $result */ $result = $proceed($pathParts); if ($this->isLoaded == true || false) { return $result; } if (($result instanceof Section) == false) { retu...
php
{ "resource": "" }
q243881
Api.cleanUrl
validation
public function cleanUrl($url) { $result = $this->_purge($url, 'PURGE', 'PURGE'); if ($result['status']) { $this->logger->execute($url); } if ($this->config->areWebHooksEnabled() && $this->config->canPublishKeyUrlChanges()) { $this->sendWebHook('*clean by UR...
php
{ "resource": "" }
q243882
Api.cleanBySurrogateKey
validation
public function cleanBySurrogateKey($keys) { $type = 'clean by key on '; $uri = $this->_getApiServiceUri() . 'purge'; $num = count($keys); $result = false; if ($num >= self::FASTLY_MAX_HEADER_KEY_SIZE) { $parts = $num / self::FASTLY_MAX_HEADER_KEY_SIZE; ...
php
{ "resource": "" }
q243883
Api.cleanAll
validation
public function cleanAll() { // Check if purge has been requested on this request if ($this->purged == true) { return true; } $this->purged = true; $type = 'clean/purge all'; $uri = $this->_getApiServiceUri() . 'purge_all'; $result = $this->_purge...
php
{ "resource": "" }
q243884
Api._purge
validation
private function _purge($uri, $type, $method = \Zend_Http_Client::POST, $payload = null) { if ($method == 'PURGE') { // create purge token $expiration = time() + self::PURGE_TOKEN_LIFETIME; $zendUri = \Zend_Uri::factory($uri); $path = $zendUri->getPath(); ...
php
{ "resource": "" }
q243885
Api.getCustomerInfo
validation
public function getCustomerInfo() { $uri = $this->config->getApiEndpoint() . 'current_customer'; $result = $this->_fetch($uri); return $result; }
php
{ "resource": "" }
q243886
Api.checkServiceDetails
validation
public function checkServiceDetails($test = false, $serviceId = null, $apiKey = null) { if (!$test) { $uri = rtrim($this->_getApiServiceUri(), '/'); $result = $this->_fetch($uri); } else { $uri = $this->config->getApiEndpoint() . 'service/' . $serviceId; ...
php
{ "resource": "" }
q243887
Api.cloneVersion
validation
public function cloneVersion($curVersion) { $url = $this->_getApiServiceUri() . 'version/'.$curVersion.'/clone'; $result = $this->_fetch($url, \Zend_Http_Client::PUT); if (!$result) { throw new LocalizedException(__('Failed to clone active version.')); } return ...
php
{ "resource": "" }
q243888
Api.addComment
validation
public function addComment($version, $comment) { $url = $this->_getApiServiceUri() . 'version/' . $version; $result = $this->_fetch($url, \Zend_Http_Client::PUT, $comment); return $result; }
php
{ "resource": "" }
q243889
Api.uploadVcl
validation
public function uploadVcl($version, $vcl) { $url = $this->_getApiServiceUri() . 'version/' .$version. '/vcl'; $result = $this->_fetch($url, 'POST', $vcl); return $result; }
php
{ "resource": "" }
q243890
Api.setVclAsMain
validation
public function setVclAsMain($version, $name) { $url = $this->_getApiServiceUri() . 'version/' .$version. '/vcl/' .$name. '/main'; $result = $this->_fetch($url, 'PUT'); return $result; }
php
{ "resource": "" }
q243891
Api.validateServiceVersion
validation
public function validateServiceVersion($version) { $url = $this->_getApiServiceUri() . 'version/' .$version. '/validate'; $result = $this->_fetch($url, 'GET'); if ($result->status == 'error') { throw new LocalizedException(__('Failed to validate service version: ' . $result->msg...
php
{ "resource": "" }
q243892
Api.activateVersion
validation
public function activateVersion($version) { $url = $this->_getApiServiceUri() . 'version/' .$version. '/activate'; $result = $this->_fetch($url, 'PUT'); return $result; }
php
{ "resource": "" }
q243893
Api.uploadSnippet
validation
public function uploadSnippet($version, array $snippet) { // Perform replacements vcl template replacements if (isset($snippet['content'])) { $adminUrl = $this->vcl->getAdminFrontName(); $adminPathTimeout = $this->config->getAdminPathTimeout(); $ignoredUrlParamete...
php
{ "resource": "" }
q243894
Api.updateSnippet
validation
public function updateSnippet(array $snippet) { $url = $this->_getApiServiceUri(). 'snippet' . '/'.$snippet['name']; $result = $this->_fetch($url, \Zend_Http_Client::PUT, $snippet); return $result; }
php
{ "resource": "" }
q243895
Api.hasSnippet
validation
public function hasSnippet($version, $name) { $url = $this->_getApiServiceUri() . 'version/' . $version . '/snippet/' . $name; $result = $this->_fetch($url, \Zend_Http_Client::GET, '', false, null, false); if ($result == false) { return false; } return true; ...
php
{ "resource": "" }
q243896
Api.createCondition
validation
public function createCondition($version, array $condition) { $checkIfExists = $this->getCondition($version, $condition['name']); $url = $this->_getApiServiceUri(). 'version/' .$version. '/condition'; if (!$checkIfExists) { $verb = \Zend_Http_Client::POST; } else { ...
php
{ "resource": "" }
q243897
Api.createHeader
validation
public function createHeader($version, array $condition) { $checkIfExists = $this->getHeader($version, $condition['name']); $url = $this->_getApiServiceUri(). 'version/' .$version. '/header'; if ($checkIfExists === false) { $verb = \Zend_Http_Client::POST; } else { ...
php
{ "resource": "" }
q243898
Api.createResponse
validation
public function createResponse($version, array $response) { $checkIfExists = $this->getResponse($version, $response['name']); $url = $this->_getApiServiceUri(). 'version/' .$version. '/response_object'; if (!$checkIfExists) { $verb = \Zend_Http_Client::POST; } else { ...
php
{ "resource": "" }
q243899
Api.getResponse
validation
public function getResponse($version, $name) { $url = $this->_getApiServiceUri(). 'version/'. $version. '/response_object/' . $name; $result = $this->_fetch($url, \Zend_Http_Client::GET); return $result; }
php
{ "resource": "" }