本文整理汇总了PHP中WindowsAzure\Common\Internal\Utilities::unserialize方法的典型用法代码示例。如果您正苦于以下问题:PHP Utilities::unserialize方法的具体用法?PHP Utilities::unserialize怎么用?PHP Utilities::unserialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WindowsAzure\Common\Internal\Utilities
的用法示例。
在下文中一共展示了Utilities::unserialize方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deserialize
/**
* Deserializes the role environment data.
*
* @param IInputChannel $inputChannel The input Channel.
*
* @return RoleEnvironmentData
*/
public function deserialize($inputChannel)
{
$document = stream_get_contents($inputChannel);
$environmentInfo = Utilities::unserialize($document);
$configurationSettings = $this->_translateConfigurationSettings($environmentInfo);
$localResources = $this->_translateLocalResources($environmentInfo);
$currentInstance = $this->_translateCurrentInstance($environmentInfo);
$roles = $this->_translateRoles($environmentInfo, $currentInstance, $environmentInfo['CurrentInstance']['@attributes']['roleName']);
return new RoleEnvironmentData($environmentInfo['Deployment']['@attributes']['id'], $configurationSettings, $localResources, $currentInstance, $roles, $environmentInfo['Deployment']['@attributes']['emulated'] == 'true');
}
示例2: getVersionMap
/**
* Gets the version map.
*
* @param string $connectionPath The connection path.
*
* @return array
*/
public function getVersionMap($connectionPath)
{
$versions = array();
$input = $this->_inputChannel->getInputStream($connectionPath);
$contents = stream_get_contents($input);
$discoveryInfo = Utilities::unserialize($contents);
$endpoints = $discoveryInfo['RuntimeServerEndpoints']['RuntimeServerEndpoint'];
if (array_key_exists('@attributes', $endpoints)) {
$endpoints = array();
$endpoints[] = $discoveryInfo['RuntimeServerEndpoints']['RuntimeServerEndpoint'];
}
foreach ($endpoints as $endpoint) {
$versions[$endpoint['@attributes']['version']] = $endpoint['@attributes']['path'];
}
return $versions;
}
示例3: deserialize
/**
* Deserializes a goal state.
*
* @param string $document The goal state document.
*
* @return GoalState
*/
public function deserialize($document)
{
$goalStateInfo = Utilities::unserialize($document);
return new GoalState($goalStateInfo['Incarnation'], $goalStateInfo['ExpectedState'], $goalStateInfo['RoleEnvironmentPath'], new \DateTime($goalStateInfo['Deadline']), $goalStateInfo['CurrentStateEndpoint']);
}
示例4: testUnserialize
/**
* @covers WindowsAzure\Common\Internal\Utilities::unserialize
* @covers WindowsAzure\Common\Internal\Utilities::_sxml2arr
*/
public function testUnserialize()
{
// Setup
$propertiesSample = TestResources::getServicePropertiesSample();
$properties = ServiceProperties::create($propertiesSample);
$xmlSerializer = new XmlSerializer();
$xml = $properties->toXml($xmlSerializer);
$expected = $properties->toArray();
// Test
$actual = Utilities::unserialize($xml);
$this->assertEquals($expected, $actual);
}
示例5: testToXml
/**
* @covers WindowsAzure\Blob\Models\ContainerAcl::toXml
* @covers WindowsAzure\Blob\Models\ContainerAcl::toArray
* @depends testCreateMultipleEntries
*/
public function testToXml($acl)
{
// Setup
$sample = TestResources::getContainerAclMultipleEntriesSample();
$expected = ContainerAcl::create('container', $sample['SignedIdentifiers']);
$xmlSerializer = new XmlSerializer();
// Test
$xml = $acl->toXml($xmlSerializer);
// Assert
$array = Utilities::unserialize($xml);
$acl = ContainerAcl::create('container', $array);
$this->assertEquals($expected->getSignedIdentifiers(), $acl->getSignedIdentifiers());
}
示例6: testToXml
/**
* @covers WindowsAzure\Common\Models\ServiceProperties::toXml
*/
public function testToXml()
{
// Setup
$properties = ServiceProperties::create(TestResources::getServicePropertiesSample());
$xmlSerializer = new XmlSerializer();
// Test
$actual = $properties->toXml($xmlSerializer);
// Assert
$actualParsed = Utilities::unserialize($actual);
$actualProperties = GetServicePropertiesResult::create($actualParsed);
$this->assertEquals($actualProperties->getValue(), $properties);
}