本文整理汇总了PHP中WindowsAzure\Common\Internal\Utilities::tryGetValue方法的典型用法代码示例。如果您正苦于以下问题:PHP Utilities::tryGetValue方法的具体用法?PHP Utilities::tryGetValue怎么用?PHP Utilities::tryGetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WindowsAzure\Common\Internal\Utilities
的用法示例。
在下文中一共展示了Utilities::tryGetValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create
/**
* Creates GetHostedServicePropertiesResult from parsed response.
*
* @param array $parsed The parsed response in array representation.
*
* @return GetHostedServicePropertiesResult
*/
public static function create($parsed)
{
$result = new GetHostedServicePropertiesResult();
$properties = Utilities::tryGetValue($parsed, Resources::XTAG_HOSTED_SERVICE_PROPERTIES);
$result->_hostedService = new HostedService($parsed, $properties);
return $result;
}
示例2: create
/**
* Creates GetStorageServicePropertiesResult from parsed response.
*
* @param array $parsed The parsed response in array representation.
*
* @return GetStorageServicePropertiesResult
*/
public static function create($parsed)
{
$result = new GetStorageServicePropertiesResult();
$properties = Utilities::tryGetValue($parsed, Resources::XTAG_STORAGE_SERVICE_PROPERTIES);
$result->_storageService = new StorageService($parsed, $properties);
return $result;
}
示例3: create
/**
* Creates ListBlobResult object from parsed XML response.
*
* @param array $parsedResponse XML response parsed into array.
*
* @return WindowsAzure\Blob\Models\ListBlobResult.
*/
public static function create($parsedResponse)
{
$result = new ListContainersResult();
$result->_prefix = Utilities::tryGetValue($parsedResponse, Resources::QP_PREFIX);
$result->_marker = Utilities::tryGetValue($parsedResponse, Resources::QP_MARKER);
$result->_nextMarker = Utilities::tryGetValue($parsedResponse, Resources::QP_NEXT_MARKER);
$result->_maxResults = Utilities::tryGetValue($parsedResponse, Resources::QP_MAX_RESULTS);
$result->_containers = array();
$rawContainer = array();
if (!empty($parsedResponse['Containers'])) {
$containersArray = $parsedResponse['Containers']['Container'];
$rawContainer = Utilities::getArray($containersArray);
}
foreach ($rawContainer as $value) {
$container = new Container();
$container->setName($value['Name']);
$container->setUrl($value['Url']);
$container->setMetadata(Utilities::tryGetValue($value, Resources::QP_METADATA, array()));
$properties = new ContainerProperties();
$date = $value['Properties']['Last-Modified'];
$date = Utilities::rfc1123ToDateTime($date);
$properties->setLastModified($date);
$properties->setEtag($value['Properties']['Etag']);
$container->setProperties($properties);
$result->_containers[] = $container;
}
return $result;
}
示例4: __construct
/**
* Constructs new affinity group object.
*/
public function __construct()
{
$sources = func_get_args();
parent::__construct($sources);
foreach ($sources as $source) {
$this->setName(Utilities::tryGetValue($source, Resources::XTAG_NAME, $this->getName()));
}
}
示例5: create
/**
* Creates WrapAccesTokenResult object from parsed XML response.
*
* @param array $response The get WRAP access token response.
*
* @return WindowsAzure\ServiceBus\Internal\WrapAccessTokenResult.
*/
public static function create($response)
{
$wrapAccessTokenResult = new self();
parse_str($response, $parsedResponse);
$wrapAccessTokenResult->setAccessToken(Utilities::tryGetValue($parsedResponse, Resources::WRAP_ACCESS_TOKEN));
$wrapAccessTokenResult->setExpiresIn(Utilities::tryGetValue($parsedResponse, Resources::WRAP_ACCESS_TOKEN_EXPIRES_IN));
return $wrapAccessTokenResult;
}
示例6: create
/**
* Creates new QueryTablesResult object
*
* @param array $headers The HTTP response headers
* @param array $entries The table entriess
*
* @return \WindowsAzure\Table\Models\QueryTablesResult
*/
public static function create($headers, $entries)
{
$result = new QueryTablesResult();
$headers = array_change_key_case($headers);
$result->setNextTableName(Utilities::tryGetValue($headers, Resources::X_MS_CONTINUATION_NEXTTABLENAME));
$result->setTables($entries);
return $result;
}
示例7: create
/**
* Create InsertEntityResult object from HTTP response parts.
*
* @param string $body The HTTP response body.
* @param array $headers The HTTP response headers.
* @param IAtomReaderWriter $atomSerializer The atom reader and writer.
*
* @return \WindowsAzure\Table\Models\InsertEntityResult
*
* @static
*/
public static function create($body, $headers, $atomSerializer)
{
$result = new InsertEntityResult();
$entity = $atomSerializer->parseEntity($body);
$entity->setETag(Utilities::tryGetValue($headers, Resources::ETAG));
$result->setEntity($entity);
return $result;
}
示例8: create
/**
* Creates new GetStorageServiceKeysResult object from parsed response.
*
* @param array $parsed The HTTP parsed response into array representation.
*
* @return GetStorageServiceKeysResult
*/
public static function create($parsed)
{
$result = new GetStorageServiceKeysResult();
$keys = Utilities::tryGetValue($parsed, Resources::XTAG_STORAGE_SERVICE_KEYS);
$result->_url = Utilities::tryGetValue($parsed, Resources::XTAG_URL);
$result->_primary = Utilities::tryGetValue($keys, Resources::XTAG_PRIMARY);
$result->_secondary = Utilities::tryGetValue($keys, Resources::XTAG_SECONDARY);
return $result;
}
示例9: __construct
/**
* Constructs new storage service object.
*
* @param array $sources The list of sources that has the row XML.
*/
public function __construct($sources = array())
{
parent::__construct($sources);
foreach ($sources as $source) {
$this->setName(Utilities::tryGetValue($source, Resources::XTAG_SERVICE_NAME, $this->getName()));
$this->setAffinityGroup(Utilities::tryGetValue($source, Resources::XTAG_AFFINITY_GROUP, $this->getAffinityGroup()));
$this->setUrl(Utilities::tryGetValue($source, Resources::XTAG_URL, $this->getUrl()));
}
}
示例10: create
/**
* Creates a new Role from parsed response body.
*
* @param array $parsed The parsed response body in array representation.
*
* @return Role
*/
public static function create($parsed)
{
$role = new Role();
$roleName = Utilities::tryGetValue($parsed, Resources::XTAG_ROLE_NAME);
$osVersion = Utilities::tryGetValue($parsed, Resources::XTAG_OS_VERSION);
$role->setOsVersion($osVersion);
$role->setRoleName($roleName);
return $role;
}
示例11: testTryGetValueWithNull
/**
* @covers WindowsAzure\Common\Internal\Utilities::tryGetValue
*/
public function testTryGetValueWithNull()
{
// Setup
$key = 10;
$data = array(10, 20, 30);
// Test
$actual = Utilities::tryGetValue($data, $key);
$this->assertNull($actual);
}
示例12: __construct
/**
* Constructs new storage service object.
*/
public function __construct()
{
$sources = func_get_args();
parent::__construct($sources);
foreach ($sources as $source) {
$this->setStatus(Utilities::tryGetValue($source, Resources::XTAG_STATUS, $this->getStatus()));
$endpoints = Utilities::tryGetValue($source, Resources::XTAG_ENDPOINTS);
$this->setEndpoints(Utilities::tryGetValue($endpoints, Resources::XTAG_ENDPOINT, $this->getEndpoints()));
}
}
示例13: create
/**
* Creates new QueryEntitiesResult instance.
*
* @param array $headers The HTTP response headers.
* @param array $entities The entities.
*
* @return QueryEntitiesResult
*/
public static function create($headers, $entities)
{
$result = new QueryEntitiesResult();
$headers = array_change_key_case($headers);
$nextPK = Utilities::tryGetValue($headers, Resources::X_MS_CONTINUATION_NEXTPARTITIONKEY);
$nextRK = Utilities::tryGetValue($headers, Resources::X_MS_CONTINUATION_NEXTROWKEY);
$result->setEntities($entities);
$result->setNextPartitionKey($nextPK);
$result->setNextRowKey($nextRK);
return $result;
}
示例14: create
/**
* Creates a new UpgradeStatus object from the parsed response.
*
* @param array $parsed The parsed response body in array representation
*
* @return \WindowsAzure\ServiceManagement\Models\UpgradeStatus
*/
public static function create($parsed)
{
$result = new self();
$upgradeType = Utilities::tryGetValue($parsed, Resources::XTAG_UPGRADE_TYPE);
$currentUpgradeDomainState = Utilities::tryGetValue($parsed, Resources::XTAG_CURRENT_UPGRADE_DOMAIN_STATE);
$currentUpgradeDomain = Utilities::tryGetValue($parsed, Resources::XTAG_CURRENT_UPGRADE_DOMAIN);
$result->setCurrentUpgradeDomain(intval($currentUpgradeDomain));
$result->setCurrentUpgradeDomainState($currentUpgradeDomainState);
$result->setUpgradeType($upgradeType);
return $result;
}
示例15: computeSignature
/**
* Computes the authorization signature for blob and queue shared key.
*
* @param array $headers request headers.
* @param string $url reuqest url.
* @param array $queryParams query variables.
* @param string $httpMethod request http method.
*
* @see Blob and Queue Services (Shared Key Authentication) at
* http://msdn.microsoft.com/en-us/library/windowsazure/dd179428.aspx
*
* @return string
*/
protected function computeSignature($headers, $url, $queryParams, $httpMethod)
{
$canonicalizedResource = parent::computeCanonicalizedResourceForTable($url, $queryParams);
$stringToSign = array();
foreach ($this->includedHeaders as $header) {
$stringToSign[] = Utilities::tryGetValue($headers, $header);
}
$stringToSign[] = $canonicalizedResource;
$stringToSign = implode("\n", $stringToSign);
return $stringToSign;
}