当前位置: 首页>>代码示例>>PHP>>正文


PHP Utilities::unserialize方法代码示例

本文整理汇总了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');
 }
开发者ID:bitmovin,项目名称:azure-sdk-for-php,代码行数:17,代码来源:XmlRoleEnvironmentDataDeserializer.php

示例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;
 }
开发者ID:bitmovin,项目名称:azure-sdk-for-php,代码行数:23,代码来源:RuntimeVersionProtocolClient.php

示例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']);
 }
开发者ID:pankajadhyapak,项目名称:um_new,代码行数:12,代码来源:XmlGoalStateDeserializer.php

示例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);
 }
开发者ID:southworkscom,项目名称:azure-sdk-for-php,代码行数:16,代码来源:UtilitiesTest.php

示例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());
 }
开发者ID:bitmovin,项目名称:azure-sdk-for-php,代码行数:18,代码来源:ContainerACLTest.php

示例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);
 }
开发者ID:bitmovin,项目名称:azure-sdk-for-php,代码行数:15,代码来源:ServicePropertiesTest.php


注:本文中的WindowsAzure\Common\Internal\Utilities::unserialize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。