// 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]
*/
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');