本文整理汇总了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;
}
示例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);
}
示例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) . '/';
}
示例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;
}
示例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'))));
}