protected function openCryptModule()
{
if (extension_loaded('mcrypt')) {
if (is_array($this->_cryptAlgorithm)) {
$module = @call_user_func_array('mcrypt_module_open', $this->_cryptAlgorithm);
} else {
$module = @mcrypt_module_open($this->_cryptAlgorithm, '', MCRYPT_MODE_CBC, '');
}
if ($module === false) {
throw new TNotSupportedException('securitymanager_mcryptextension_initfailed');
}
return $module;
} else {
throw new TNotSupportedException('securitymanager_mcryptextension_required');
}
}