isExtensionLoaded() public static method

Check if extension is loaded
public static isExtensionLoaded ( $extensionName ) : boolean
$extensionName
return boolean Returns true if extension is loaded
コード例 #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.'));
     }
 }
コード例 #2
0
 protected function checkStandardPHPLibrary()
 {
     $requirement = new Gpf_Install_Requirement();
     $requirement->setResult(Gpf_Php::isExtensionLoaded('SPL'));
     $requirement->setPositiveName($this->_('Standard PHP Library is on'));
     $requirement->setNegativeName($this->_('Application requires Standard PHP Library extension'));
     $requirement->setFixDescription($this->_('Please recompile your PHP with Standard PHP Library extension'));
     $this->addRequirement($requirement);
 }