/**
  * 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;
 }
Esempio n. 3
0
 /**
  * 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;
 }
Esempio n. 4
0
 /**
  * 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);
 }
Esempio n. 5
0
 /**
  * @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);
 }