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


PHP SimpleSAML_Configuration::getLocalizedString方法代码示例

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


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

示例1: addAttributeConsumingService

 /**
  * Add an AttributeConsumingService element to the metadata.
  *
  * @param \SAML2\XML\md\SPSSODescriptor $spDesc The SPSSODescriptor element.
  * @param SimpleSAML_Configuration     $metadata The metadata.
  */
 private function addAttributeConsumingService(\SAML2\XML\md\SPSSODescriptor $spDesc, SimpleSAML_Configuration $metadata)
 {
     $attributes = $metadata->getArray('attributes', array());
     $name = $metadata->getLocalizedString('name', null);
     if ($name === null || count($attributes) == 0) {
         // we cannot add an AttributeConsumingService without name and attributes
         return;
     }
     $attributesrequired = $metadata->getArray('attributes.required', array());
     /*
      * Add an AttributeConsumingService element with information as name and description and list
      * of requested attributes
      */
     $attributeconsumer = new \SAML2\XML\md\AttributeConsumingService();
     $attributeconsumer->index = 0;
     $attributeconsumer->ServiceName = $name;
     $attributeconsumer->ServiceDescription = $metadata->getLocalizedString('description', array());
     $nameFormat = $metadata->getString('attributes.NameFormat', \SAML2\Constants::NAMEFORMAT_UNSPECIFIED);
     foreach ($attributes as $friendlyName => $attribute) {
         $t = new \SAML2\XML\md\RequestedAttribute();
         $t->Name = $attribute;
         if (!is_int($friendlyName)) {
             $t->FriendlyName = $friendlyName;
         }
         if ($nameFormat !== \SAML2\Constants::NAMEFORMAT_UNSPECIFIED) {
             $t->NameFormat = $nameFormat;
         }
         if (in_array($attribute, $attributesrequired)) {
             $t->isRequired = true;
         }
         $attributeconsumer->RequestedAttribute[] = $t;
     }
     $spDesc->AttributeConsumingService[] = $attributeconsumer;
 }
开发者ID:simplesamlphp,项目名称:simplesamlphp,代码行数:40,代码来源:SAMLBuilder.php

示例2: addAttributeConsumingService

 /**
  * Add an AttributeConsumingService element to the metadata.
  *
  * @param DOMElement $spDesc  The SPSSODescriptor element.
  * @param SimpleSAML_Configuration $metadata  The metadata.
  */
 private function addAttributeConsumingService(SAML2_XML_md_SPSSODescriptor $spDesc, SimpleSAML_Configuration $metadata)
 {
     $attributes = $metadata->getArray('attributes', array());
     $name = $metadata->getLocalizedString('name', NULL);
     if ($name === NULL || count($attributes) == 0) {
         /* We cannot add an AttributeConsumingService without name and attributes. */
         return;
     }
     /*
      * Add an AttributeConsumingService element with information as name and description and list
      * of requested attributes
      */
     $attributeconsumer = new SAML2_XML_md_AttributeConsumingService();
     $attributeconsumer->index = 0;
     $attributeconsumer->ServiceName = $name;
     $attributeconsumer->ServiceDescription = $metadata->getLocalizedString('description', array());
     $nameFormat = $metadata->getString('attributes.NameFormat', SAML2_Const::NAMEFORMAT_UNSPECIFIED);
     foreach ($attributes as $attribute) {
         $t = new SAML2_XML_md_RequestedAttribute();
         $t->Name = $attribute;
         if ($nameFormat !== SAML2_Const::NAMEFORMAT_UNSPECIFIED) {
             $t->NameFormat = $nameFormat;
         }
         $attributeconsumer->RequestedAttribute[] = $t;
     }
     $spDesc->AttributeConsumingService[] = $attributeconsumer;
 }
开发者ID:hooplad,项目名称:saml-20-single-sign-on,代码行数:33,代码来源:SAMLBuilder.php


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