/**
  * 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;
 }
Exemplo 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;
 }
Exemplo 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);
 }
Exemplo 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);
 }
Exemplo n.º 6
0
/**
 * System.Get API.
 *
 * @param array $params
 *
 * @return array
 */
function civicrm_api3_system_get($params)
{
    $config = CRM_Core_Config::singleton();
    $returnValues = array(array('version' => CRM_Utils_System::version(), 'uf' => CIVICRM_UF, 'php' => array('version' => phpversion(), 'tz' => date_default_timezone_get(), 'extensions' => get_loaded_extensions(), 'ini' => _civicrm_api3_system_get_redacted_ini()), 'mysql' => array('version' => CRM_Core_DAO::singleValueQuery('SELECT @@version')), 'cms' => array('type' => CIVICRM_UF, 'modules' => CRM_Core_Module::collectStatuses($config->userSystem->getModules())), 'civi' => array('version' => CRM_Utils_System::version(), 'dev' => (bool) CRM_Utils_System::isDevelopment(), 'components' => array_keys(CRM_Core_Component::getEnabledComponents()), 'extensions' => preg_grep('/^uninstalled$/', CRM_Extension_System::singleton()->getManager()->getStatuses(), PREG_GREP_INVERT), 'exampleUrl' => CRM_Utils_System::url('civicrm/example', NULL, TRUE, NULL, FALSE))));
    return civicrm_api3_create_success($returnValues, $params, 'System', 'get');
}
Exemplo n.º 7
0
/**
 * System.Get API.
 *
 * @param array $params
 *
 * @return array
 */
function civicrm_api3_system_get($params)
{
    $config = CRM_Core_Config::singleton();
    $returnValues = array(array('version' => CRM_Utils_System::version(), 'uf' => CIVICRM_UF, 'php' => array('version' => phpversion(), 'time' => time(), 'tz' => date_default_timezone_get(), 'sapi' => php_sapi_name(), 'extensions' => get_loaded_extensions(), 'ini' => _civicrm_api3_system_get_redacted_ini()), 'mysql' => array('version' => CRM_Core_DAO::singleValueQuery('SELECT @@version'), 'time' => CRM_Core_DAO::singleValueQuery('SELECT unix_timestamp()'), 'vars' => _civicrm_api3_system_get_redacted_mysql()), 'cms' => array('version' => $config->userSystem->getVersion(), 'type' => CIVICRM_UF, 'modules' => CRM_Core_Module::collectStatuses($config->userSystem->getModules())), 'civi' => array('version' => CRM_Utils_System::version(), 'dev' => (bool) CRM_Utils_System::isDevelopment(), 'components' => array_keys(CRM_Core_Component::getEnabledComponents()), 'extensions' => preg_grep('/^uninstalled$/', CRM_Extension_System::singleton()->getManager()->getStatuses(), PREG_GREP_INVERT), 'multidomain' => CRM_Core_DAO::singleValueQuery('SELECT count(*) FROM civicrm_domain') > 1, 'settings' => _civicrm_api3_system_get_redacted_settings(), 'exampleUrl' => CRM_Utils_System::url('civicrm/example', NULL, TRUE, NULL, FALSE)), 'http' => array('software' => CRM_Utils_Array::value('SERVER_SOFTWARE', $_SERVER), 'forwarded' => !empty($_SERVER['HTTP_X_FORWARDED_FOR']) || !empty($_SERVER['X_FORWARDED_PROTO']), 'port' => empty($_SERVER['SERVER_PORT']) || $_SERVER['SERVER_PORT'] == 80 || $_SERVER['SERVER_PORT'] == 443 ? 'Standard' : 'Nonstandard'), 'os' => array('type' => php_uname('s'), 'release' => php_uname('r'), 'version' => php_uname('v'), 'machine' => php_uname('m'))));
    return civicrm_api3_create_success($returnValues, $params, 'System', 'get');
}
Exemplo n.º 8
0
 /**
  * Flush information about loaded modules
  */
 function clearModuleList()
 {
     CRM_Utils_Hook::singleton(TRUE);
     CRM_Core_PseudoConstant::getModuleExtensions(TRUE);
     CRM_Core_Module::getAll(TRUE);
 }