/** * Process CJT Self delete modules only if there is modules * available. * * Note: Modules can deleted them self after a while. * * The main concern is to avoid * CJTModulesEngine or any other modules * is resposible for setting cjt_process_modules value. * * @return void. */ private function processSDModules() { $modulesDirectory = 'modules'; $modulesListOptionName = MODULES_LIST_CACHE_VAR_PREFIX . "-{$modulesDirectory}"; $processModules = get_option($modulesListOptionName); // IF processmodules is not array it means that this is the first time to run after // the plugin installed and no list cached list, so give the modules engine the chance to collect the data. // IF processModules is array but empty it means that modules deleted themself // and no more modules to process. if (!is_array($processModules) || is_array($processModules) && !empty($processModules)) { // Process/Load modules. require_once CJTOOLBOX_INCLUDE_PATH . '/modules.inc.php'; require_once CJTOOLBOX_INCLUDE_PATH . '/modulebase.inc.php'; self::$modulesEngine = CJTModulesEngine::getInstance($modulesDirectory); self::$modulesEngine->processAll(); } }