* @method static array synchronizeUsers() Create CRM contacts for all existing CMS users.
* @method static void appendCoreResources(\Civi\Core\Event\GenericHookEvent $e) Callback for hook_civicrm_coreResourceList.
* @method static void alterAssetUrl(\Civi\Core\Event\GenericHookEvent $e) Callback for hook_civicrm_getAssetUrl.
+ * @method static exitAfterFatal() Should the current execution exit after a fatal error?
*/
class CRM_Utils_System {
public static function authenticate($name, $password, $loadCMSBootstrap = FALSE, $realPath = NULL) {
$config = CRM_Core_Config::singleton();
- /* Before we do any loading, let's start the session and write to it.
- * We typically call authenticate only when we need to bootstrap the CMS
- * directly via Civi and hence bypass the normal CMS auth and bootstrap
- * process typically done in CLI and cron scripts. See: CRM-12648
- *
- * Q: Can we move this to the userSystem class so that it can be tuned
- * per-CMS? For example, when dealing with UnitTests UF, does it need to
- * do this session write since the original issue was for Drupal.
- */
- $session = CRM_Core_Session::singleton();
- $session->set('civicrmInitSession', TRUE);
-
return $config->userSystem->authenticate($name, $password, $loadCMSBootstrap, $realPath);
}
// a bit aggressive, but livable for now
CRM_Utils_Cache::singleton()->flush();
- // Traditionally, systems running on memory-backed caches were quite
- // zealous about destroying *all* memory-backed caches during a flush().
- // These flushes simulate that legacy behavior. However, they should probably
- // be removed at some point.
- $localDrivers = ['CRM_Utils_Cache_ArrayCache', 'CRM_Utils_Cache_NoCache'];
- if (Civi\Core\Container::isContainerBooted()
- && !in_array(get_class(CRM_Utils_Cache::singleton()), $localDrivers)) {
+ if (Civi\Core\Container::isContainerBooted()) {
Civi::cache('long')->flush();
Civi::cache('settings')->flush();
Civi::cache('js_strings')->flush();
Civi::cache('customData')->flush();
Civi::cache('contactTypes')->clear();
Civi::cache('metadata')->clear();
+ \Civi\Core\ClassScanner::cache('index')->flush();
CRM_Extension_System::singleton()->getCache()->flush();
CRM_Cxn_CiviCxnHttp::singleton()->getCache()->flush();
}