From: Roland Häder Date: Fri, 7 Aug 2009 23:06:36 +0000 (+0000) Subject: Missing method added, renamed X-Git-Url: https://git.mxchange.org/?p=core.git;a=commitdiff_plain;h=3de33dfa34616e40f816621bd191b536148ae2cb Missing method added, renamed --- 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');