當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。