Ejemplo n.º 1
0
 /**
  * Constructor
  *
  * @param array $config Array of config.
  */
 public function __construct($config = array())
 {
     if (!function_exists('password_hash')) {
         throw new CakeException('password_hash() is not available.');
     }
     parent::__construct($config);
 }
Ejemplo n.º 2
0
 /**
  * Constructor
  *
  * @param array $config configuration options for this object. Requires the
  * `hashers` key to be present in the array with a list of other hashers to be
  * used
  */
 public function __construct(array $config = [])
 {
     parent::__construct($config);
     foreach ($this->_config['hashers'] as $key => $hasher) {
         if (!is_string($hasher)) {
             $hasher += ['className' => $key];
         }
         $this->_hashers[] = PasswordHasherFactory::build($hasher);
     }
 }
Ejemplo n.º 3
0
 /**
  * Constructor
  *
  * @param array $config configuration options for this object. Requires the
  * `hashers` key to be present in the array with a list of other hashers to be
  * used
  */
 public function __construct(array $config = [])
 {
     parent::__construct($config);
     foreach ($this->_config['hashers'] as $key => $hasher) {
         if (is_array($hasher) && !isset($hasher['className'])) {
             $hasher['className'] = $key;
         }
         $this->_hashers[] = PasswordHasherFactory::build($hasher);
     }
 }