/** * Get an instance */ public static function singleton($fresh = FALSE) { static $singleton; if ($fresh || !$singleton) { $singleton = new CRM_Core_ManagedEntities(CRM_Core_Module::getAll(), NULL); } return $singleton; }
/** * Get an instance */ public static function singleton($fresh = FALSE) { static $singleton; if ($fresh || !$singleton) { $declarations = array(); CRM_Utils_Hook::managed($declarations); $singleton = new CRM_Core_ManagedEntities(CRM_Core_Module::getAll(), $declarations); } return $singleton; }
/** * Get an instance */ public static function singleton($fresh = FALSE) { static $singleton; if ($fresh || !$singleton) { $declarations = array(); foreach (CRM_Core_Component::getEnabledComponents() as $component) { $declarations = array_merge($declarations, $component->getManagedEntities()); } CRM_Utils_Hook::managed($declarations); $singleton = new CRM_Core_ManagedEntities(CRM_Core_Module::getAll(), $declarations); } return $singleton; }
/** * Flush information about loaded modules. */ public function clearModuleList() { CRM_Extension_System::singleton()->getCache()->flush(); CRM_Utils_Hook::singleton(TRUE); CRM_Core_PseudoConstant::getModuleExtensions(TRUE); CRM_Core_Module::getAll(TRUE); }
/** * @param $expectedIsActive * @param $key */ public function assertModuleActiveByKey($expectedIsActive, $key) { foreach (CRM_Core_Module::getAll() as $module) { if ($module->name == $key) { $this->assertEquals((bool) $expectedIsActive, (bool) $module->is_active); return; } } $this->assertEquals($expectedIsActive, FALSE); }
/** * Flush information about loaded modules */ function clearModuleList() { CRM_Utils_Hook::singleton(TRUE); CRM_Core_PseudoConstant::getModuleExtensions(TRUE); CRM_Core_Module::getAll(TRUE); }