AdminPageFramework_Requirement::check PHP Метод

check() публичный Метод

public check ( )
    public function check()
    {
        $_aWarnings = array();
        $_aWarnings[] = $this->_getWarningByType('php');
        $_aWarnings[] = $this->_getWarningByType('wordpress');
        $_aWarnings[] = $this->_getWarningByType('mysql');
        $this->_aRequirements = $this->_aRequirements + array('functions' => array(), 'classes' => array(), 'constants' => array(), 'files' => array());
        $_aWarnings = array_merge($_aWarnings, $this->_checkFunctions($this->_aRequirements['functions']), $this->_checkClasses($this->_aRequirements['classes']), $this->_checkConstants($this->_aRequirements['constants']), $this->_checkFiles($this->_aRequirements['files']));
        $this->aWarnings = array_filter($_aWarnings);
        return count($this->aWarnings);
    }

Usage Example

 /**
  * 
  * @since            3.5.0
  */
 private function _checkRequirements()
 {
     $_oRequirementCheck = new AdminPageFramework_Requirement(AdminPageFrameworkLoader_Registry::$aRequirements, AdminPageFrameworkLoader_Registry::NAME);
     if ($_oRequirementCheck->check()) {
         $_oRequirementCheck->deactivatePlugin($this->sFilePath, __('Deactivating the plugin', 'admin-page-framework-loader'), true);
     }
 }