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


PHP SAML2_Utils::extractLocalizedStrings方法代码示例

本文整理汇总了PHP中SAML2_Utils::extractLocalizedStrings方法的典型用法代码示例。如果您正苦于以下问题:PHP SAML2_Utils::extractLocalizedStrings方法的具体用法?PHP SAML2_Utils::extractLocalizedStrings怎么用?PHP SAML2_Utils::extractLocalizedStrings使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SAML2_Utils的用法示例。


在下文中一共展示了SAML2_Utils::extractLocalizedStrings方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testExtractLocalizedString

 /**
  * Test retrieval of a localized string for a given node.
  */
 public function testExtractLocalizedString()
 {
     $document = SAML2_DOMDocumentFactory::fromString('<root xmlns="' . SAML2_Const::NS_MD . '">' . '<somenode xml:lang="en">value (en)</somenode>' . '<somenode xml:lang="no">value (no)</somenode>' . '</root>');
     $localizedStringValues = SAML2_Utils::extractLocalizedStrings($document->firstChild, SAML2_Const::NS_MD, 'somenode');
     $this->assertTrue(count($localizedStringValues) === 2);
     $this->assertEquals('value (en)', $localizedStringValues["en"]);
     $this->assertEquals('value (no)', $localizedStringValues["no"]);
 }
开发者ID:Shalmezad,项目名称:saml2,代码行数:11,代码来源:UtilsTest.php

示例2: __construct

 /**
  * Create/parse a mdrpi:RegistrationInfo element.
  *
  * @param DOMElement|NULL $xml  The XML element we should load.
  */
 public function __construct(DOMElement $xml = NULL)
 {
     if ($xml === NULL) {
         return;
     }
     if (!$xml->hasAttribute('registrationAuthority')) {
         throw new Exception('Missing required attribute "registrationAuthority" in mdrpi:RegistrationInfo element.');
     }
     $this->registrationAuthority = $xml->getAttribute('registrationAuthority');
     if ($xml->hasAttribute('registrationInstant')) {
         $this->registrationInstant = SimpleSAML_Utilities::parseSAML2Time($xml->getAttribute('registrationInstant'));
     }
     $this->RegistrationPolicy = SAML2_Utils::extractLocalizedStrings($xml, SAML2_XML_mdrpi_Common::NS_MDRPI, 'RegistrationPolicy');
 }
开发者ID:emma5021,项目名称:toba,代码行数:19,代码来源:RegistrationInfo.php

示例3: __construct

 /**
  * Create/parse a mdrpi:PublicationInfo element.
  *
  * @param DOMElement|NULL $xml The XML element we should load.
  * @throws Exception
  */
 public function __construct(DOMElement $xml = NULL)
 {
     if ($xml === NULL) {
         return;
     }
     if (!$xml->hasAttribute('publisher')) {
         throw new Exception('Missing required attribute "publisher" in mdrpi:PublicationInfo element.');
     }
     $this->publisher = $xml->getAttribute('publisher');
     if ($xml->hasAttribute('creationInstant')) {
         $this->creationInstant = SAML2_Utils::xsDateTimeToTimestamp($xml->getAttribute('creationInstant'));
     }
     if ($xml->hasAttribute('publicationId')) {
         $this->publicationId = $xml->getAttribute('publicationId');
     }
     $this->UsagePolicy = SAML2_Utils::extractLocalizedStrings($xml, SAML2_XML_mdrpi_Common::NS_MDRPI, 'UsagePolicy');
 }
开发者ID:Shalmezad,项目名称:saml2,代码行数:23,代码来源:PublicationInfo.php

示例4: __construct

 /**
  * Initialize / parse an AttributeConsumingService.
  *
  * @param DOMElement|NULL $xml The XML element we should load.
  * @throws Exception
  */
 public function __construct(DOMElement $xml = NULL)
 {
     if ($xml === NULL) {
         return;
     }
     if (!$xml->hasAttribute('index')) {
         throw new Exception('Missing index on AttributeConsumingService.');
     }
     $this->index = (int) $xml->getAttribute('index');
     $this->isDefault = SAML2_Utils::parseBoolean($xml, 'isDefault', NULL);
     $this->ServiceName = SAML2_Utils::extractLocalizedStrings($xml, SAML2_Const::NS_MD, 'ServiceName');
     if (empty($this->ServiceName)) {
         throw new Exception('Missing ServiceName in AttributeConsumingService.');
     }
     $this->ServiceDescription = SAML2_Utils::extractLocalizedStrings($xml, SAML2_Const::NS_MD, 'ServiceDescription');
     foreach (SAML2_Utils::xpQuery($xml, './saml_metadata:RequestedAttribute') as $ra) {
         $this->RequestedAttribute[] = new SAML2_XML_md_RequestedAttribute($ra);
     }
 }
开发者ID:Shalmezad,项目名称:saml2,代码行数:25,代码来源:AttributeConsumingService.php

示例5: __construct

 /**
  * Initialize an Organization element.
  *
  * @param DOMElement|NULL $xml  The XML element we should load.
  */
 public function __construct(DOMElement $xml = NULL)
 {
     if ($xml === NULL) {
         return;
     }
     $this->Extensions = SAML2_XML_md_Extensions::getList($xml);
     $this->OrganizationName = SAML2_Utils::extractLocalizedStrings($xml, SAML2_Const::NS_MD, 'OrganizationName');
     if (empty($this->OrganizationName)) {
         $this->OrganizationName = array('invalid' => '');
     }
     $this->OrganizationDisplayName = SAML2_Utils::extractLocalizedStrings($xml, SAML2_Const::NS_MD, 'OrganizationDisplayName');
     if (empty($this->OrganizationDisplayName)) {
         $this->OrganizationDisplayName = array('invalid' => '');
     }
     $this->OrganizationURL = SAML2_Utils::extractLocalizedStrings($xml, SAML2_Const::NS_MD, 'OrganizationURL');
     if (empty($this->OrganizationURL)) {
         $this->OrganizationURL = array('invalid' => '');
     }
 }
开发者ID:emma5021,项目名称:toba,代码行数:24,代码来源:Organization.php

示例6: __construct

 /**
  * Create a UIInfo element.
  *
  * @param DOMElement|NULL $xml The XML element we should load.
  */
 public function __construct(DOMElement $xml = NULL)
 {
     if ($xml === NULL) {
         return;
     }
     $this->DisplayName = SAML2_Utils::extractLocalizedStrings($xml, self::NS, 'DisplayName');
     $this->Description = SAML2_Utils::extractLocalizedStrings($xml, self::NS, 'Description');
     $this->InformationURL = SAML2_Utils::extractLocalizedStrings($xml, self::NS, 'InformationURL');
     $this->PrivacyStatementURL = SAML2_Utils::extractLocalizedStrings($xml, self::NS, 'PrivacyStatementURL');
     foreach (SAML2_Utils::xpQuery($xml, './*') as $node) {
         if ($node->namespaceURI === self::NS) {
             switch ($node->localName) {
                 case 'Keywords':
                     $this->Keywords[] = new SAML2_XML_mdui_Keywords($node);
                     break;
                 case 'Logo':
                     $this->Logo[] = new SAML2_XML_mdui_Logo($node);
                     break;
             }
         } else {
             $this->children[] = new SAML2_XML_Chunk($node);
         }
     }
 }
开发者ID:danielkjfrog,项目名称:docker,代码行数:29,代码来源:UIInfo.php


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