4 require_once
'Services/User/exceptions/class.ilUserException.php';
30 foreach(
$config as $key => $value)
32 switch(strtolower($key))
34 case 'default_password_encoder':
49 $encoder_directory =
'Services/Password/classes/encoders';
50 foreach(
new DirectoryIterator($encoder_directory) as
$file)
60 require_once $file->getPathname();
61 $class_name = preg_replace(
'/(class\.)(.*?)(\.php)/',
'$2', $file->getBasename());
62 if(class_exists($class_name))
64 $reflection =
new ReflectionClass($class_name);
65 $encoder = $reflection->newInstanceArgs(
array($config));
68 $this->encoders[$encoder->getName()] = $encoder;
104 $this->encoders =
array();
105 foreach($encoders as $encoder)
109 throw new ilUserException(sprintf(
'One of the passed encoders is not valid: %s.', json_encode($encoder)));
111 $this->encoders[$encoder->getName()] = $encoder;
131 if(!isset($this->encoders[$name]))
133 if(!$get_default_on_mismatch)
135 throw new ilUserException(sprintf(
'The encoder "%s" was not configured.', $name));
139 throw new ilUserException(
'No default encoder specified, fallback not possible.');
143 throw new ilUserException(
"No default encoder found for name: '{$this->getDefaultEncoder()}'.");
149 return $this->encoders[$name];
Class for user related exception handling in ILIAS.
__construct(array $config=array())
setEncoders(array $encoders)
isSupportedByRuntime()
Returns whether or not the encoder is supported by the runtime (PHP, HHVM, ...)
Create styles array
The data for the language used.
getSupportedEncoderNames()
setDefaultEncoder($default_encoder)
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
getEncoderByName($name, $get_default_on_mismatch=false)