Example #1
0
 /**
  * Initialize the encryption module
  * 
  * @throws \Exception If the encryption module cannot be initialized
  */
 protected static function initialize()
 {
     if ((self::$resTd = mcrypt_module_open($GLOBALS['TL_CONFIG']['encryptionCipher'], '', $GLOBALS['TL_CONFIG']['encryptionMode'], '')) == false) {
         throw new \Exception('Error initializing encryption module');
     }
     if ($GLOBALS['TL_CONFIG']['encryptionKey'] == '') {
         throw new \Exception('Encryption key not set');
     }
 }
Example #2
0
 /**
  * Initialize the encryption module
  *
  * @throws \Exception If the encryption module cannot be initialized
  */
 protected static function initialize()
 {
     if (!in_array('mcrypt', get_loaded_extensions())) {
         throw new \Exception('The PHP mcrypt extension is not installed');
     }
     if ((self::$resTd = mcrypt_module_open(\Config::get('encryptionCipher'), '', \Config::get('encryptionMode'), '')) == false) {
         throw new \Exception('Error initializing encryption module');
     }
     if (\Config::get('encryptionKey') == '') {
         throw new \Exception('Encryption key not set');
     }
 }
Example #3
0
 /**
  * Initialize the encryption module
  * 
  * @throws \Exception If the encryption module cannot be initialized
  */
 protected static function initialize()
 {
     if (!in_array('mcrypt', get_loaded_extensions())) {
         throw new \Exception('The PHP mcrypt extension is not installed');
     }
     if ((self::$resTd = mcrypt_module_open($GLOBALS['TL_CONFIG']['encryptionCipher'], '', $GLOBALS['TL_CONFIG']['encryptionMode'], '')) == false) {
         throw new \Exception('Error initializing encryption module');
     }
     if ($GLOBALS['TL_CONFIG']['encryptionKey'] == '') {
         throw new \Exception('Encryption key not set');
     }
 }