本文整理匯總了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'))));
}