]> git.mxchange.org Git - core.git/commitdiff
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 5f961a1c925828af16e3447953362e3a00141f66..a3edd83f849d377d9df6466bdff450f08e594d91 100644 (file)
@@ -1126,6 +1126,20 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                // Simple hash code
                return crc32($this->__toString());
        }
                // 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]
 }
 
 // [EOF]
index 38a541b0937ded05109e391682a446d000cf0249..2335f5dc5a534855c556de2034d315fe8b2c1206 100644 (file)
@@ -103,9 +103,9 @@ class CryptoHelper extends BaseFrameworkSystem implements Cryptable {
         */
        protected function attachCryptoStream () {
                // Do we have mcrypt loaded?
         */
        protected function attachCryptoStream () {
                // Do we have mcrypt loaded?
-               if ($this->isPhpModuleLoaded('mcrypt')) {
+               if ($this->isPhpExtensionLoaded('mcrypt')) {
                        // Then use it
                        // 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');
                } else {
                        // If nothing works ...
                        $this->cryptoStreamInstance = ObjectFactory::createObjectByName('NullCryptoStream');