Gpf_Php::isExtensionLoaded PHP Method

isExtensionLoaded() public static method

Check if extension is loaded
public static isExtensionLoaded ( $extensionName ) : boolean
$extensionName
return boolean Returns true if extension is loaded
        public static function isExtensionLoaded($extensionName)
        {
            return extension_loaded($extensionName);
        }

Usage Example

 /**
  * Method will be called, when plugin is activated. e.g. create some tables required by plugin.
  *
  * @throws Gpf_Exception when plugin can not be activated
  */
 public function onActivate() {
     if (Gpf_Paths::getInstance()->isDevelopementVersion()) {
         return;
     }
     if(!Gpf_Php::isFunctionEnabled('iconv')) {
         throw new Gpf_Exception($this->_('Please enable "iconv" extension.'));
     }
     if(!Gpf_Php::isExtensionLoaded('ionCube Loader')) {
         throw new Gpf_Exception($this->_('Please enable "ionCube Loader" extension.'));
     }
 }
All Usage Examples Of Gpf_Php::isExtensionLoaded