當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SimpleSAML_Configuration::resolvePath方法代碼示例

本文整理匯總了PHP中SimpleSAML_Configuration::resolvePath方法的典型用法代碼示例。如果您正苦於以下問題:PHP SimpleSAML_Configuration::resolvePath方法的具體用法?PHP SimpleSAML_Configuration::resolvePath怎麽用?PHP SimpleSAML_Configuration::resolvePath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SimpleSAML_Configuration的用法示例。


在下文中一共展示了SimpleSAML_Configuration::resolvePath方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setupTwig

 /**
  * Setup twig.
  */
 private function setupTwig()
 {
     $auto_reload = $this->configuration->getBoolean('template.auto_reload', true);
     $cache = false;
     if (!$auto_reload) {
         // Cache only used if auto_reload = false
         $cache = $this->configuration->getString('template.cache', $this->configuration->resolvePath('cache'));
     }
     // set up template paths
     $loader = $this->setupTwigTemplatepaths();
     // abort if twig template does not exist
     if (!$loader->exists($this->twig_template)) {
         return false;
     }
     // load extra i18n domains
     if ($this->module) {
         $this->localization->addModuleDomain($this->module);
     }
     $options = array('cache' => $cache, 'auto_reload' => $auto_reload, 'translation_function' => array('\\SimpleSAML\\Locale\\Translate', 'translateSingularNativeGettext'), 'translation_function_plural' => array('\\SimpleSAML\\Locale\\Translate', 'translatePluralNativeGettext'));
     // set up translation
     if ($this->localization->i18nBackend === \SimpleSAML\Locale\Localization::GETTEXT_I18N_BACKEND) {
         $options['translation_function'] = array('\\SimpleSAML\\Locale\\Translate', 'translateSingularGettext');
         $options['translation_function_plural'] = array('\\SimpleSAML\\Locale\\Translate', 'translatePluralGettext');
     }
     // TODO: add a branch for the old SimpleSAMLphp backend
     $twig = new Twig_Environment($loader, $options);
     $twig->addExtension(new Twig_Extensions_Extension_I18n());
     return $twig;
 }
開發者ID:simplesamlphp,項目名稱:simplesamlphp,代碼行數:32,代碼來源:Template.php

示例2: __construct

 public function __construct(\SimpleSAML_Configuration $config)
 {
     $storeConfig = $config->getValue('ticketstore', array('directory' => 'ticketcache'));
     if (!is_string($storeConfig['directory'])) {
         throw new Exception('Invalid directory option in config.');
     }
     $path = $config->resolvePath($storeConfig['directory']);
     if (!is_dir($path)) {
         throw new Exception('Directory for CAS Server ticket storage [' . $path . '] does not exists. ');
     }
     if (!is_writable($path)) {
         throw new Exception('Directory for CAS Server ticket storage [' . $path . '] is not writable. ');
     }
     $this->pathToTicketDirectory = preg_replace('/\\/$/', '', $path);
 }
開發者ID:simplesamlphp,項目名稱:simplesamlphp-module-casserver,代碼行數:15,代碼來源:FileSystemTicketStore.php

示例3: __construct

 public function __construct(array $config)
 {
     if (!is_string($config['directory'])) {
         throw new Exception('Invalid directory option in config.');
     }
     $conf = new SimpleSAML_Configuration(array(), '');
     $path = $conf->resolvePath($config['directory']);
     if (!is_dir($path)) {
         throw new Exception('Invalid storage directory [' . $path . '].');
     }
     if (!is_writable($path)) {
         throw new Exception('Storage directory [' . $path . '] is not writable.');
     }
     $this->directory = preg_replace('/\\/$/', '', $path) . '/';
 }
開發者ID:shamus13,項目名稱:simplesamlphp-module-oauth2server,代碼行數:15,代碼來源:FileSystemStore.php

示例4: getDomainLocaleDir

 /**
  * Get the default locale dir for a specific module aka. domain
  *
  * @param string $domain Name of module/domain
  */
 public function getDomainLocaleDir($domain)
 {
     $localeDir = $this->configuration->resolvePath('modules') . '/' . $domain . '/locales';
     return $localeDir;
 }
開發者ID:restena-sw,項目名稱:simplesamlphp,代碼行數:10,代碼來源:Localization.php

示例5: evilObjectCreator

 private function evilObjectCreator($id, $expire)
 {
     $conf = new \SimpleSAML_Configuration(array(), '');
     $path = $conf->resolvePath('tests');
     $filename = $path . '/' . $expire . '-' . $id;
     file_put_contents($filename, serialize(array('jsonString' => array(json_encode('dummy')), 'objectClass' => array('jsonObject'))));
 }
開發者ID:shamus13,項目名稱:simplesamlphp-module-oauth2server,代碼行數:7,代碼來源:FileSystemStoreTest.php


注:本文中的SimpleSAML_Configuration::resolvePath方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。