_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 83 13k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q255200 | AliasProcessor.closeIndex | test | private function closeIndex(Client $client, $indexName)
{
try {
$path = sprintf('%s/_close', $indexName);
$client->request($path, Request::POST);
} catch (ExceptionInterface $e) {
throw new \RuntimeException(
sprintf(
'Failed to... | php | {
"resource": ""
} |
q255201 | AliasProcessor.getAliasedIndex | test | private function getAliasedIndex(Client $client, $aliasName)
{
$aliasesInfo = $client->request('_aliases', 'GET')->getData();
$aliasedIndexes = [];
foreach ($aliasesInfo as $indexName => $indexInfo) {
if ($indexName === $aliasName) {
throw new AliasIsIndexExcepti... | php | {
"resource": ""
} |
q255202 | Client.logQuery | test | private function logQuery($path, $method, $data, array $query, $queryTime, $engineMS = 0, $itemCount = 0)
{
if (!$this->_logger or !$this->_logger instanceof ElasticaLogger) {
return;
}
$connection = $this->getLastRequest()->getConnection();
$connectionArray = [
... | php | {
"resource": ""
} |
q255203 | Listener.postPersist | test | public function postPersist(LifecycleEventArgs $eventArgs)
{
$entity = $eventArgs->getObject();
if ($this->objectPersister->handlesObject($entity) && $this->isObjectIndexable($entity)) {
$this->scheduledForInsertion[] = $entity;
}
} | php | {
"resource": ""
} |
q255204 | Listener.postUpdate | test | public function postUpdate(LifecycleEventArgs $eventArgs)
{
$entity = $eventArgs->getObject();
if ($this->objectPersister->handlesObject($entity)) {
if ($this->isObjectIndexable($entity)) {
$this->scheduledForUpdate[] = $entity;
} else {
// De... | php | {
"resource": ""
} |
q255205 | Listener.preRemove | test | public function preRemove(LifecycleEventArgs $eventArgs)
{
$entity = $eventArgs->getObject();
if ($this->objectPersister->handlesObject($entity)) {
$this->scheduleForDeletion($entity);
}
} | php | {
"resource": ""
} |
q255206 | Listener.persistScheduled | test | private function persistScheduled()
{
if ($this->shouldPersist()) {
if (count($this->scheduledForInsertion)) {
$this->objectPersister->insertMany($this->scheduledForInsertion);
$this->scheduledForInsertion = [];
}
if (count($this->scheduled... | php | {
"resource": ""
} |
q255207 | Listener.scheduleForDeletion | test | private function scheduleForDeletion($object)
{
if ($identifierValue = $this->propertyAccessor->getValue($object, $this->config['identifier'])) {
$this->scheduledForDeletion[] = !is_scalar($identifierValue) ? (string) $identifierValue : $identifierValue;
}
} | php | {
"resource": ""
} |
q255208 | Listener.isObjectIndexable | test | private function isObjectIndexable($object)
{
return $this->indexable->isObjectIndexable(
$this->config['indexName'],
$this->config['typeName'],
$object
);
} | php | {
"resource": ""
} |
q255209 | RepositoryManager.getRepository | test | public function getRepository($entityName)
{
$realEntityName = $entityName;
if (false !== strpos($entityName, ':')) {
list($namespaceAlias, $simpleClassName) = explode(':', $entityName);
$realEntityName = $this->managerRegistry->getAliasNamespace($namespaceAlias).'\\'.$simple... | php | {
"resource": ""
} |
q255210 | ModelToElasticaIdentifierTransformer.transform | test | public function transform($object, array $fields)
{
$identifier = $this->propertyAccessor->getValue($object, $this->options['identifier']);
return new Document($identifier);
} | php | {
"resource": ""
} |
q255211 | RepositoryManager.getRepository | test | public function getRepository($typeName)
{
if (isset($this->repositories[$typeName])) {
return $this->repositories[$typeName];
}
if (!isset($this->types[$typeName])) {
throw new RuntimeException(sprintf('No search finder configured for %s', $typeName));
}
... | php | {
"resource": ""
} |
q255212 | HashidsFactory.make | test | public function make(array $config): Hashids
{
$config = $this->getConfig($config);
return $this->getClient($config);
} | php | {
"resource": ""
} |
q255213 | HashidsServiceProvider.registerFactory | test | protected function registerFactory(): void
{
$this->app->singleton('hashids.factory', function () {
return new HashidsFactory();
});
$this->app->alias('hashids.factory', HashidsFactory::class);
} | php | {
"resource": ""
} |
q255214 | Api.verifyHash | test | public function verifyHash(array $params)
{
if (empty($params['HASH'])) {
return false;
}
$hash = $params['HASH'];
unset($params['HASH']);
return $hash === $this->calculateHash($params);
} | php | {
"resource": ""
} |
q255215 | HttpClientFactory.createGuzzle | test | public static function createGuzzle()
{
$client = null;
if (!class_exists(Client::class)) {
@trigger_error('The function "HttpClientFactory::createGuzzle" is depcrecated and will be removed in 2.0.', E_USER_DEPRECATED);
throw new \LogicException('Can not use "HttpClientFactor... | php | {
"resource": ""
} |
q255216 | CookieJar.addCookie | test | public function addCookie(Cookie $cookie): void
{
$this->cookies[$this->getHash($cookie)] = $cookie;
} | php | {
"resource": ""
} |
q255217 | CookieJar.addCookieHeaders | test | public function addCookieHeaders(RequestInterface $request): RequestInterface
{
$cookies = [];
foreach ($this->getCookies() as $cookie) {
if ($cookie->matchesRequest($request)) {
$cookies[] = $cookie->toCookieHeader();
}
}
if ($cookies) {
... | php | {
"resource": ""
} |
q255218 | CookieJar.clearExpiredCookies | test | public function clearExpiredCookies(): void
{
$cookies = $this->getCookies();
foreach ($cookies as $i => $cookie) {
if ($cookie->isExpired()) {
unset($cookies[$i]);
}
}
$this->clear();
$this->setCookies(array_values($cookies));
} | php | {
"resource": ""
} |
q255219 | CookieJar.getHash | test | private function getHash(Cookie $cookie): string
{
return sha1(sprintf(
'%s|%s|%s',
$cookie->getName(),
$cookie->getAttribute(Cookie::ATTR_DOMAIN),
$cookie->getAttribute(Cookie::ATTR_PATH)
));
} | php | {
"resource": ""
} |
q255220 | ResponseBuilder.addHeader | test | public function addHeader(string $input): void
{
list($key, $value) = explode(':', $input, 2);
$this->response = $this->response->withAddedHeader(trim($key), trim($value));
} | php | {
"resource": ""
} |
q255221 | ResponseBuilder.parseHttpHeaders | test | public function parseHttpHeaders(array $headers): void
{
$headers = $this->filterHeaders($headers);
$statusLine = array_shift($headers);
try {
$this->setStatus($statusLine);
} catch (InvalidArgumentException $e) {
array_unshift($headers, $statusLine);
... | php | {
"resource": ""
} |
q255222 | DigestAuthMiddleware.handleRequest | test | public function handleRequest(RequestInterface $request, callable $next)
{
$this->setUri($request->getUri()->getPath());
$this->setMethod(strtoupper($request->getMethod()));
$this->setEntityBody($request->getBody()->__toString());
$header = $this->getHeader();
if (null !== $... | php | {
"resource": ""
} |
q255223 | DigestAuthMiddleware.setOptions | test | public function setOptions($options): void
{
if ($options & self::OPTION_QOP_AUTH_INT) {
if ($options & self::OPTION_QOP_AUTH) {
throw new \InvalidArgumentException('DigestAuthMiddleware: Only one value of OPTION_QOP_AUTH_INT or OPTION_QOP_AUTH may be set.');
}
... | php | {
"resource": ""
} |
q255224 | DigestAuthMiddleware.getClientNonce | test | private function getClientNonce(): ?string
{
if (null == $this->clientNonce) {
$this->clientNonce = uniqid();
if (null == $this->nonceCount) {
// If nonceCount is not set then set it to 00000001.
$this->nonceCount = '00000001';
} else {
... | php | {
"resource": ""
} |
q255225 | DigestAuthMiddleware.getHA1 | test | private function getHA1(): ?string
{
$username = $this->getUsername();
$password = $this->getPassword();
$realm = $this->getRealm();
if (($username) && ($password) && ($realm)) {
$algorithm = $this->getAlgorithm();
if ('MD5' === $algorithm) {
... | php | {
"resource": ""
} |
q255226 | DigestAuthMiddleware.getHA2 | test | private function getHA2(): ?string
{
$method = $this->getMethod();
$uri = $this->getUri();
if (($method) && ($uri)) {
$qop = $this->getQOP();
if (null === $qop || 'auth' === $qop) {
$A2 = "{$method}:{$uri}";
} elseif ('auth-int' === $qop)... | php | {
"resource": ""
} |
q255227 | DigestAuthMiddleware.getHeader | test | private function getHeader(): ?string
{
if ('Digest' == $this->getAuthenticationMethod()) {
$username = $this->getUsername();
$realm = $this->getRealm();
$nonce = $this->getNonce();
$response = $this->getResponse();
if (($username) && ($realm) && (... | php | {
"resource": ""
} |
q255228 | DigestAuthMiddleware.getResponse | test | private function getResponse(): ?string
{
$HA1 = $this->getHA1();
$nonce = $this->getNonce();
$HA2 = $this->getHA2();
if (null !== $HA1 && ($nonce) && null !== $HA2) {
$qop = $this->getQOP();
if (empty($qop)) {
$response = $this->hash("{$HA1}... | php | {
"resource": ""
} |
q255229 | DigestAuthMiddleware.getQOP | test | private function getQOP(): ?string
{
// Has the server specified any options for Quality of Protection
if (\count($this->qop) > 0) {
if ($this->options & self::OPTION_QOP_AUTH_INT) {
if (\in_array('auth-int', $this->qop)) {
return 'auth-int';
... | php | {
"resource": ""
} |
q255230 | DigestAuthMiddleware.hash | test | private function hash($value): ?string
{
$algorithm = $this->getAlgorithm();
if (('MD5' == $algorithm) || ('MD5-sess' == $algorithm)) {
return hash('md5', $value);
}
return null;
} | php | {
"resource": ""
} |
q255231 | DigestAuthMiddleware.parseAuthenticationInfoHeader | test | private function parseAuthenticationInfoHeader(string $authenticationInfo): void
{
$nameValuePairs = $this->parseNameValuePairs($authenticationInfo);
foreach ($nameValuePairs as $name => $value) {
switch ($name) {
case 'message-qop':
break;
... | php | {
"resource": ""
} |
q255232 | DigestAuthMiddleware.parseNameValuePairs | test | private function parseNameValuePairs(string $nameValuePairs): array
{
$parsedNameValuePairs = [];
$nameValuePairs = explode(',', $nameValuePairs);
foreach ($nameValuePairs as $nameValuePair) {
// Trim the Whitespace from the start and end of the name value pair string
... | php | {
"resource": ""
} |
q255233 | DigestAuthMiddleware.parseWwwAuthenticateHeader | test | private function parseWwwAuthenticateHeader(string $wwwAuthenticate): void
{
if ('Digest ' == substr($wwwAuthenticate, 0, 7)) {
$this->setAuthenticationMethod('Digest');
// Remove "Digest " from start of header
$wwwAuthenticate = substr($wwwAuthenticate, 7, \strlen($wwwAu... | php | {
"resource": ""
} |
q255234 | DigestAuthMiddleware.setAlgorithm | test | private function setAlgorithm(string $algorithm): void
{
if (('MD5' == $algorithm) || ('MD5-sess' == $algorithm)) {
$this->algorithm = $algorithm;
} else {
throw new \InvalidArgumentException('DigestAuthMiddleware: Only MD5 and MD5-sess algorithms are currently supported.');
... | php | {
"resource": ""
} |
q255235 | DigestAuthMiddleware.setMethod | test | private function setMethod(string $method = null): void
{
if ('GET' == $method) {
$this->method = 'GET';
return;
}
if ('POST' == $method) {
$this->method = 'POST';
return;
}
if ('PUT' == $method) {
$this->method = ... | php | {
"resource": ""
} |
q255236 | DigestAuthMiddleware.unquoteString | test | private function unquoteString(string $str = null): ?string
{
if ($str) {
if ('"' == substr($str, 0, 1)) {
$str = substr($str, 1, \strlen($str) - 1);
}
if ('"' == substr($str, \strlen($str) - 1, 1)) {
$str = substr($str, 0, \strlen($str) - ... | php | {
"resource": ""
} |
q255237 | ParameterBag.add | test | public function add(array $parameters = []): self
{
// Make sure to merge Curl parameters
if (isset($this->parameters['curl'])
&& isset($parameters['curl'])
&& \is_array($this->parameters['curl'])
&& \is_array($parameters['curl'])) {
$parameters['curl'... | php | {
"resource": ""
} |
q255238 | HeaderConverter.toBuzzHeaders | test | public static function toBuzzHeaders(array $headers): array
{
$buzz = [];
foreach ($headers as $key => $values) {
if (!\is_array($values)) {
$buzz[] = sprintf('%s: %s', $key, $values);
} else {
foreach ($values as $value) {
... | php | {
"resource": ""
} |
q255239 | HeaderConverter.toPsrHeaders | test | public static function toPsrHeaders(array $headers): array
{
$psr = [];
foreach ($headers as $header) {
list($key, $value) = explode(':', $header, 2);
$psr[trim($key)][] = trim($value);
}
return $psr;
} | php | {
"resource": ""
} |
q255240 | MultiCurl.sendAsyncRequest | test | public function sendAsyncRequest(RequestInterface $request, array $options = []): void
{
$options = $this->validateOptions($options);
$this->addToQueue($request, $options);
} | php | {
"resource": ""
} |
q255241 | MultiCurl.sendRequest | test | public function sendRequest(RequestInterface $request, array $options = []): ResponseInterface
{
$options = $this->validateOptions($options);
$originalCallback = $options->get('callback');
$responseToReturn = null;
$options = $options->add(['callback' => function (RequestInterface $r... | php | {
"resource": ""
} |
q255242 | MultiCurl.proceed | test | public function proceed(): void
{
if (empty($this->queue)) {
return;
}
if (!$this->curlm) {
$this->initMultiCurlHandle();
}
$this->initQueue();
$exception = null;
do {
// Start processing each handler in the stack
... | php | {
"resource": ""
} |
q255243 | MultiCurl.initMultiCurlHandle | test | private function initMultiCurlHandle(): void
{
$this->curlm = curl_multi_init();
if (false === $this->curlm) {
throw new ClientException('Unable to create a new cURL multi handle');
}
if ($this->serverPushSupported) {
$userCallbacks = $this->pushFunctions;
... | php | {
"resource": ""
} |
q255244 | MultiCurl.cleanup | test | private function cleanup(): void
{
if (empty($this->queue)) {
curl_multi_close($this->curlm);
$this->curlm = null;
$this->pushFunctions = [];
$this->pushCb = [];
}
} | php | {
"resource": ""
} |
q255245 | Cookie.matchesRequest | test | public function matchesRequest(RequestInterface $request): bool
{
$uri = $request->getUri();
// domain
if (!$this->matchesDomain($uri->getHost())) {
return false;
}
// path
if (!$this->matchesPath($uri->getPath())) {
return false;
}
... | php | {
"resource": ""
} |
q255246 | Cookie.isExpired | test | public function isExpired(): bool
{
$maxAge = $this->getAttribute(static::ATTR_MAX_AGE);
if ($maxAge && time() - $this->getCreatedAt() > $maxAge) {
return true;
}
$expires = $this->getAttribute(static::ATTR_EXPIRES);
if ($expires && strtotime($expires) < time()) ... | php | {
"resource": ""
} |
q255247 | Cookie.matchesDomain | test | public function matchesDomain(string $domain): bool
{
$cookieDomain = $this->getAttribute(static::ATTR_DOMAIN) ?? '';
if (0 === strpos($cookieDomain, '.')) {
$pattern = '/\b'.preg_quote(substr($cookieDomain, 1), '/').'$/i';
return (bool) preg_match($pattern, $domain);
... | php | {
"resource": ""
} |
q255248 | Cookie.matchesPath | test | public function matchesPath(string $path): bool
{
$needle = $this->getAttribute(static::ATTR_PATH);
return null === $needle || 0 === strpos($path, $needle);
} | php | {
"resource": ""
} |
q255249 | Cookie.fromSetCookieHeader | test | public function fromSetCookieHeader(string $header, string $issuingDomain): void
{
list($this->name, $header) = explode('=', $header, 2);
if (false === strpos($header, ';')) {
$this->value = $header;
$header = null;
} else {
list($this->value, $header) = e... | php | {
"resource": ""
} |
q255250 | AbstractCurl.releaseHandle | test | protected function releaseHandle($curl): void
{
if (\count($this->handles) >= $this->maxHandles) {
curl_close($curl);
} else {
// Remove all callback functions as they can hold onto references
// and are not cleaned up by curl_reset. Using curl_setopt_array
... | php | {
"resource": ""
} |
q255251 | AbstractCurl.prepare | test | protected function prepare($curl, RequestInterface $request, ParameterBag $options): ResponseBuilder
{
if (\defined('CURLOPT_PROTOCOLS')) {
curl_setopt($curl, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);
curl_setopt($curl, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_... | php | {
"resource": ""
} |
q255252 | AbstractCurl.setOptionsFromRequest | test | private function setOptionsFromRequest($curl, RequestInterface $request): void
{
$options = [
CURLOPT_CUSTOMREQUEST => $request->getMethod(),
CURLOPT_URL => $request->getUri()->__toString(),
CURLOPT_HTTPHEADER => HeaderConverter::toBuzzHeaders($request->getHeaders()),
... | php | {
"resource": ""
} |
q255253 | Browser.sendRequest | test | public function sendRequest(RequestInterface $request, array $options = []): ResponseInterface
{
$chain = $this->createMiddlewareChain($this->middleware, function (RequestInterface $request, callable $responseChain) use ($options) {
$response = $this->client->sendRequest($request, $options);
... | php | {
"resource": ""
} |
q255254 | Journal.record | test | public function record(RequestInterface $request, ResponseInterface $response, float $duration = null): void
{
$this->addEntry(new Entry($request, $response, $duration));
} | php | {
"resource": ""
} |
q255255 | Image.createImage | test | protected function createImage()
{
if ($this->_isCreated) {
return false;
}
$command = $this->getCommand();
$fileName = $this->getImageFilename();
$command->addArgs($this->_options);
// Always escape input and output filename
$command->addArg((str... | php | {
"resource": ""
} |
q255256 | Pdf.addCover | test | public function addCover($input, $options = array(), $type = null)
{
$options['input'] = ($this->version9 ? '--' : '') . 'cover';
$options['inputArg'] = $this->ensureUrlOrFile($input, $type);
$this->_objects[] = $this->ensureUrlOrFileOptions($options);
return $this;
} | php | {
"resource": ""
} |
q255257 | Pdf.addToc | test | public function addToc($options = array())
{
$options['input'] = ($this->version9 ? '--' : '') . 'toc';
$this->_objects[] = $this->ensureUrlOrFileOptions($options);
return $this;
} | php | {
"resource": ""
} |
q255258 | Pdf.createPdf | test | protected function createPdf()
{
if ($this->_isCreated) {
return false;
}
$command = $this->getCommand();
$fileName = $this->getPdfFilename();
$command->addArgs($this->_options);
foreach ($this->_objects as $object) {
$command->addArgs($object... | php | {
"resource": ""
} |
q255259 | Pdf.ensureUrlOrFile | test | protected function ensureUrlOrFile($input, $type = null)
{
if ($input instanceof File) {
$this->_tmpFiles[] = $input;
return $input;
} elseif (preg_match(self::REGEX_URL, $input)) {
return $input;
} elseif ($type === self::TYPE_XML || $type === null && pre... | php | {
"resource": ""
} |
q255260 | ServiceRestProxy.createClient | test | private static function createClient(array $options)
{
$verify = true;
//Disable SSL if proxy has been set, and set the proxy in the client.
$proxy = getenv('HTTP_PROXY');
// For testing with Fiddler
// $proxy = 'localhost:8888';
// $verify = false;
if (!empty... | php | {
"resource": ""
} |
q255261 | ServiceRestProxy.createMiddlewareStack | test | protected function createMiddlewareStack(ServiceOptions $serviceOptions)
{
//If handler stack is not defined by the user, create a default
//middleware stack.
$stack = null;
if (array_key_exists('stack', $this->options['http'])) {
$stack = $this->options['http']['stack'];... | php | {
"resource": ""
} |
q255262 | ServiceRestProxy.createRequest | test | protected function createRequest(
$method,
array $headers,
array $queryParams,
array $postParameters,
$path,
$locationMode,
$body = Resources::EMPTY_STRING
) {
if ($locationMode == LocationMode::SECONDARY_ONLY ||
$locationMode == LocationMo... | php | {
"resource": ""
} |
q255263 | ServiceRestProxy.sendAsync | test | protected function sendAsync(
$method,
array $headers,
array $queryParams,
array $postParameters,
$path,
$expected = Resources::STATUS_OK,
$body = Resources::EMPTY_STRING,
ServiceOptions $serviceOptions = null
) {
if ($serviceOptions == null) {... | php | {
"resource": ""
} |
q255264 | ServiceRestProxy.generateRequestOptions | test | protected function generateRequestOptions(
ServiceOptions $serviceOptions,
callable $handler
) {
$result = array();
$result[Resources::ROS_LOCATION_MODE] = $serviceOptions->getLocationMode();
$result[Resources::ROS_STREAM] = $serviceOptions->getIsStreaming();
... | php | {
"resource": ""
} |
q255265 | ServiceRestProxy.sendContextAsync | test | protected function sendContextAsync(HttpCallContext $context)
{
return $this->sendAsync(
$context->getMethod(),
$context->getHeaders(),
$context->getQueryParameters(),
$context->getPostParameters(),
$context->getPath(),
$context->getSta... | php | {
"resource": ""
} |
q255266 | ServiceRestProxy.throwIfError | test | public static function throwIfError(ResponseInterface $response, $expected)
{
$expectedStatusCodes = is_array($expected) ? $expected : array($expected);
if (!in_array($response->getStatusCode(), $expectedStatusCodes)) {
throw new ServiceException($response);
}
} | php | {
"resource": ""
} |
q255267 | ServiceRestProxy.addPostParameter | test | public function addPostParameter(
array $postParameters,
$key,
$value
) {
Validate::isArray($postParameters, 'postParameters');
$postParameters[$key] = $value;
return $postParameters;
} | php | {
"resource": ""
} |
q255268 | ServiceRestProxy.addMetadataHeaders | test | protected function addMetadataHeaders(array $headers, array $metadata = null)
{
Utilities::validateMetadata($metadata);
$metadata = $this->generateMetadataHeaders($metadata);
$headers = array_merge($headers, $metadata);
return $headers;
} | php | {
"resource": ""
} |
q255269 | ServiceRestProxy.addLocationHeaderToResponse | test | private static function addLocationHeaderToResponse(
ResponseInterface $response,
$locationMode
) {
//If the response already has this header, return itself.
if ($response->hasHeader(Resources::X_MS_CONTINUATION_LOCATION_MODE)) {
return $response;
}
//Othe... | php | {
"resource": ""
} |
q255270 | Entity._validateProperties | test | private function _validateProperties($properties)
{
Validate::isArray($properties, 'entity properties');
foreach ($properties as $key => $value) {
Validate::canCastAsString($key, 'key');
Validate::isTrue(
$value instanceof Property,
Resources:... | php | {
"resource": ""
} |
q255271 | Entity.getPropertyValue | test | public function getPropertyValue($name)
{
$p = Utilities::tryGetValue($this->_properties, $name);
return is_null($p) ? null : $p->getValue();
} | php | {
"resource": ""
} |
q255272 | Entity.setPropertyValue | test | public function setPropertyValue($name, $value)
{
$p = Utilities::tryGetValue($this->_properties, $name);
if (!is_null($p)) {
$p->setValue($value);
}
} | php | {
"resource": ""
} |
q255273 | Entity.setProperty | test | public function setProperty($name, $property)
{
Validate::isTrue($property instanceof Property, Resources::INVALID_PROP_MSG);
$this->_properties[$name] = $property;
} | php | {
"resource": ""
} |
q255274 | Entity.addProperty | test | public function addProperty($name, $edmType, $value, $rawValue = '')
{
$p = new Property();
$p->setEdmType($edmType);
$p->setValue($value);
$p->setRawValue($rawValue);
$this->setProperty($name, $p);
} | php | {
"resource": ""
} |
q255275 | Entity.isValid | test | public function isValid(&$msg = null)
{
try {
$this->_validateProperties($this->_properties);
} catch (\Exception $exc) {
$msg = $exc->getMessage();
return false;
}
if (is_null($this->getPartitionKey())
|| is_null($this->getRowKey())
... | php | {
"resource": ""
} |
q255276 | GetTableResult.create | test | public static function create($body, $odataSerializer)
{
$result = new GetTableResult();
$name = $odataSerializer->parseTable($body);
$result->setName($name);
return $result;
} | php | {
"resource": ""
} |
q255277 | SharedKeyAuthScheme.computeSignature | test | protected function computeSignature(
array $headers,
$url,
array $queryParams,
$httpMethod
) {
$canonicalizedHeaders = $this->computeCanonicalizedHeaders($headers);
$canonicalizedResource = $this->computeCanonicalizedResource(
$url,
$queryPara... | php | {
"resource": ""
} |
q255278 | SharedKeyAuthScheme.getAuthorizationHeader | test | public function getAuthorizationHeader(
array $headers,
$url,
array $queryParams,
$httpMethod
) {
$signature = $this->computeSignature(
$headers,
$url,
$queryParams,
$httpMethod
);
return 'SharedKey ' . $this->a... | php | {
"resource": ""
} |
q255279 | SharedKeyAuthScheme.computeCanonicalizedHeaders | test | protected function computeCanonicalizedHeaders($headers)
{
$canonicalizedHeaders = array();
$normalizedHeaders = array();
$validPrefix = Resources::X_MS_HEADER_PREFIX;
if (is_null($normalizedHeaders)) {
return $canonicalizedHeaders;
}
foreac... | php | {
"resource": ""
} |
q255280 | SharedKeyAuthScheme.computeCanonicalizedResourceForTable | test | protected function computeCanonicalizedResourceForTable($url, $queryParams)
{
$queryParams = array_change_key_case($queryParams);
// 1. Beginning with an empty string (""), append a forward slash (/),
// followed by the name of the account that owns the accessed resource.
$canoni... | php | {
"resource": ""
} |
q255281 | SharedKeyAuthScheme.computeCanonicalizedResource | test | protected function computeCanonicalizedResource($url, $queryParams)
{
$queryParams = array_change_key_case($queryParams);
// 1. Beginning with an empty string (""), append a forward slash (/),
// followed by the name of the account that owns the accessed resource.
$canonicalizedR... | php | {
"resource": ""
} |
q255282 | ACLBase.toXml | test | public function toXml(XmlSerializer $serializer)
{
$properties = array(
XmlSerializer::DEFAULT_TAG => Resources::XTAG_SIGNED_IDENTIFIER,
XmlSerializer::ROOT_NAME => Resources::XTAG_SIGNED_IDENTIFIERS
);
return $serializer->serialize($this->toArray(), $properties);
... | php | {
"resource": ""
} |
q255283 | ACLBase.fromXmlArray | test | public function fromXmlArray(array $parsed = null)
{
$this->setSignedIdentifiers(array());
// Initialize signed identifiers.
if (!empty($parsed) &&
is_array($parsed[Resources::XTAG_SIGNED_IDENTIFIER])
) {
$entries = $parsed[Resources::XTAG_SIGNED_IDENTIFI... | php | {
"resource": ""
} |
q255284 | ACLBase.addSignedIdentifier | test | public function addSignedIdentifier(
$id,
\DateTime $start,
\DateTime $expiry,
$permissions
) {
Validate::canCastAsString($id, 'id');
if ($start != null) {
Validate::isDate($start);
}
Validate::isDate($expiry);
Validate::canCastAsSt... | php | {
"resource": ""
} |
q255285 | ACLBase.removeSignedIdentifier | test | public function removeSignedIdentifier($id)
{
Validate::canCastAsString($id, 'id');
//var_dump($this->signedIdentifiers);
for ($i = 0; $i < count($this->signedIdentifiers); ++$i) {
if ($this->signedIdentifiers[$i]->getId() == $id) {
array_splice($this->signedIdent... | php | {
"resource": ""
} |
q255286 | BatchOperations.setOperations | test | public function setOperations(array $operations)
{
$this->_operations = array();
foreach ($operations as $operation) {
$this->addOperation($operation);
}
} | php | {
"resource": ""
} |
q255287 | BatchOperations.addOperation | test | public function addOperation($operation)
{
Validate::isTrue(
$operation instanceof BatchOperation,
Resources::INVALID_BO_TYPE_MSG
);
$this->_operations[] = $operation;
} | php | {
"resource": ""
} |
q255288 | BatchOperations.addInsertEntity | test | public function addInsertEntity($table, Entity $entity)
{
Validate::canCastAsString($table, 'table');
Validate::notNullOrEmpty($entity, 'entity');
$operation = new BatchOperation();
$type = BatchOperationType::INSERT_ENTITY_OPERATION;
$operation->setType($type);
... | php | {
"resource": ""
} |
q255289 | BatchOperations.addDeleteEntity | test | public function addDeleteEntity($table, $partitionKey, $rowKey, $etag = null)
{
Validate::canCastAsString($table, 'table');
Validate::isTrue(!is_null($partitionKey), Resources::NULL_TABLE_KEY_MSG);
Validate::isTrue(!is_null($rowKey), Resources::NULL_TABLE_KEY_MSG);
$operation = new ... | php | {
"resource": ""
} |
q255290 | CopyFileResult.create | test | public static function create(array $headers)
{
$result = new CopyFileResult();
$headers = array_change_key_case($headers);
$date = $headers[Resources::LAST_MODIFIED];
$date = Utilities::rfc1123ToDateTime($date);
$result->setCopyStatus($headers[Resources:... | php | {
"resource": ""
} |
q255291 | QueueMessage.createFromListMessages | test | public static function createFromListMessages(array $parsedResponse)
{
$timeNextVisible = $parsedResponse['TimeNextVisible'];
$msg = self::createFromPeekMessages($parsedResponse);
$date = Utilities::rfc1123ToDateTime($timeNextVisible);
$msg->setTimeNextVisible($date);
$msg-... | php | {
"resource": ""
} |
q255292 | QueueMessage.createFromPeekMessages | test | public static function createFromPeekMessages(array $parsedResponse)
{
$msg = new QueueMessage();
$expirationDate = $parsedResponse['ExpirationTime'];
$insertionDate = $parsedResponse['InsertionTime'];
$msg->setDequeueCount(intval($parsedResponse['DequeueCount']));
... | php | {
"resource": ""
} |
q255293 | QueueMessage.createFromCreateMessage | test | public static function createFromCreateMessage(array $parsedResponse)
{
$msg = new QueueMessage();
$expirationDate = $parsedResponse['ExpirationTime'];
$insertionDate = $parsedResponse['InsertionTime'];
$timeNextVisible = $parsedResponse['TimeNextVisible'];
$date = Utili... | php | {
"resource": ""
} |
q255294 | StorageServiceSettings.init | test | protected static function init()
{
self::$useDevelopmentStorageSetting = self::setting(
Resources::USE_DEVELOPMENT_STORAGE_NAME,
'true'
);
self::$developmentStorageProxyUriSetting = self::settingWithFunc(
Resources::DEVELOPMENT_STORAGE_PROXY_URI_NAME,
... | php | {
"resource": ""
} |
q255295 | StorageServiceSettings.getDevelopmentStorageAccount | test | private static function getDevelopmentStorageAccount($proxyUri)
{
if (is_null($proxyUri)) {
return self::developmentStorageAccount();
}
$scheme = parse_url($proxyUri, PHP_URL_SCHEME);
$host = parse_url($proxyUri, PHP_URL_HOST);
$prefix = $scheme . "://" . $host... | php | {
"resource": ""
} |
q255296 | StorageServiceSettings.developmentStorageAccount | test | public static function developmentStorageAccount()
{
if (is_null(self::$devStoreAccount)) {
self::$devStoreAccount = self::getDevelopmentStorageAccount(
Resources::DEV_STORE_URI
);
}
return self::$devStoreAccount;
} | php | {
"resource": ""
} |
q255297 | StorageServiceSettings.getServiceEndpoint | test | private static function getServiceEndpoint(
$scheme,
$accountName,
$dnsPrefix,
$dnsSuffix = null,
$isSecondary = false
) {
if ($isSecondary) {
$accountName .= Resources::SECONDARY_STRING;
}
if ($dnsSuffix === null) {
$dnsSuffix ... | php | {
"resource": ""
} |
q255298 | StorageServiceSettings.createStorageServiceSettings | test | private static function createStorageServiceSettings(
array $settings,
$blobEndpointUri = null,
$queueEndpointUri = null,
$tableEndpointUri = null,
$fileEndpointUri = null,
$blobSecondaryEndpointUri = null,
$queueSecondaryEndpointUri = null,
$tableSecondar... | php | {
"resource": ""
} |
q255299 | StorageServiceSettings.createFromConnectionString | test | public static function createFromConnectionString($connectionString)
{
$tokenizedSettings = self::parseAndValidateKeys($connectionString);
// Devstore case
$matchedSpecs = self::matchedSpecification(
$tokenizedSettings,
self::allRequired(self::$useDevelopmentStorageS... | php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.