Gpf_Php::isFunctionEnabled PHP Method

isFunctionEnabled() public static method

Check if function is enabled and exists in php
public static isFunctionEnabled ( $functionName ) : boolean
$functionName
return boolean Returns true if function exists and is enabled
        public static function isFunctionEnabled($functionName)
        {
            if (function_exists($functionName) && strstr(ini_get("disable_functions"), $functionName) === false) {
                return true;
            }
            return false;
        }

Usage Example

コード例 #1
0
 /**
  * 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::isFunctionEnabled