Missing method added, renamed
authorRoland Häder <roland@mxchange.org>
Fri, 7 Aug 2009 23:06:36 +0000 (23:06 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 7 Aug 2009 23:06:36 +0000 (23:06 +0000)
inc/classes/main/class_BaseFrameworkSystem.php
inc/classes/main/crypto/class_CryptoHelper.php

index 5f961a1..a3edd83 100644 (file)
@@ -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]
index 38a541b..2335f5d 100644 (file)
@@ -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');