From 3de33dfa34616e40f816621bd191b536148ae2cb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 7 Aug 2009 23:06:36 +0000 Subject: [PATCH] Missing method added, renamed --- inc/classes/main/class_BaseFrameworkSystem.php | 14 ++++++++++++++ inc/classes/main/crypto/class_CryptoHelper.php | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index 5f961a1c..a3edd83f 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -1126,6 +1126,20 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { // Simple hash code return crc32($this->__toString()); } + + /** + * Checks wether the given PHP extension is loaded + * + * @param $phpExtension The PHP extension we shall check + * @return $isLoaded Wether the PHP extension is loaded + */ + public final function isPhpExtensionLoaded ($phpExtension) { + // Is it loaded? + $isLoaded = in_array($phpExtension, get_loaded_extensions()); + + // Return result + return $isLoaded; + } } // [EOF] diff --git a/inc/classes/main/crypto/class_CryptoHelper.php b/inc/classes/main/crypto/class_CryptoHelper.php index 38a541b0..2335f5dc 100644 --- a/inc/classes/main/crypto/class_CryptoHelper.php +++ b/inc/classes/main/crypto/class_CryptoHelper.php @@ -103,9 +103,9 @@ class CryptoHelper extends BaseFrameworkSystem implements Cryptable { */ protected function attachCryptoStream () { // Do we have mcrypt loaded? - if ($this->isPhpModuleLoaded('mcrypt')) { + if ($this->isPhpExtensionLoaded('mcrypt')) { // Then use it - $this->cryptoStreamInstance = ObjectFactory::createObjectByName('McryptStream', array($this->rngInstance())) + $this->cryptoStreamInstance = ObjectFactory::createObjectByName('McryptStream', array($this->rngInstance())); } else { // If nothing works ... $this->cryptoStreamInstance = ObjectFactory::createObjectByName('NullCryptoStream'); -- 2.39.5