$cache = CRM_Utils_Cache::create([
'name' => "bao_$group",
- 'type' => array('*memory*', 'SqlGroup', 'ArrayCache'),
+ 'type' => ['*memory*', 'SqlGroup', 'ArrayCache'],
// We're replacing CRM_Core_BAO_Cache, which traditionally used a front-cache
// that was not aware of TTLs. So it seems more consistent/performant to
// use 'fast' here.
* @return array
*/
public static function getLegacyGroups() {
- return [
+ $groups = [
// Core
'CiviCRM Search PrevNextCache',
'contact fields',
'custom data',
// Universe
- 'dashboard', // be.chiro.civi.atomfeeds
- 'lineitem-editor', // biz.jmaconsulting.lineitemedit
- 'HRCore_Info', // civihr/uk.co.compucorp.civicrm.hrcore
- 'CiviCRM setting Spec', // nz.co.fuzion.entitysetting
- 'descendant groups for an org', // org.civicrm.multisite
+
+ // be.chiro.civi.atomfeeds
+ 'dashboard',
+
+ // biz.jmaconsulting.lineitemedit
+ 'lineitem-editor',
+
+ // civihr/uk.co.compucorp.civicrm.hrcore
+ 'HRCore_Info',
+
+ // nz.co.fuzion.entitysetting
+ 'CiviCRM setting Spec',
+
];
+ // Handle Legacy Multisite caching group.
+ $extensions = CRM_Extension_System::singleton()->getManager();
+ $multisiteExtensionStatus = $extensions->getStatus('org.civicrm.multisite');
+ if ($multisiteExtensionStatus == $extensions::STATUS_INSTALLED) {
+ $extension_version = civicrm_api3('Extension', 'get', ['key' => 'org.civicrm.multisite'])['values'][0]['version'];
+ if (version_compare($extension_version, '2.7', '<')) {
+ Civi::log()->warning(
+ 'CRM_Core_BAO_Cache_PSR is deprecated for multisite extension, you should upgrade to the latest version to avoid this warning, this code will be removed at the end of 2019',
+ ['civi.tag' => 'deprecated']
+ );
+ $groups[] = 'descendant groups for an org';
+ }
+ }
+ return $groups;
}
}