lithium\storage\session\strategy\Encrypt::__construct PHP Méthode

__construct() public méthode

Constructor.
public __construct ( array $config = [] ) : void
$config array Configuration array. You can override the default cipher and mode.
Résultat void
    public function __construct(array $config = array())
    {
        if (!static::enabled()) {
            throw new ConfigException("The Mcrypt extension is not installed or enabled.");
        }
        if (!isset($config['secret'])) {
            throw new ConfigException("Encrypt strategy requires a secret key.");
        }
        parent::__construct($config + $this->_defaults);
        $cipher = $this->_config['cipher'];
        $mode = $this->_config['mode'];
        static::$_resource = mcrypt_module_open($cipher, '', $mode, '');
        $this->_config['vector'] = static::_vector();
    }