/** * Get or set the single instance of CRM_Core_Resources * * @param $instance CRM_Core_Resources, new copy of the manager * @return CRM_Core_Resources */ public static function singleton(CRM_Core_Resources $instance = NULL) { if ($instance !== NULL) { self::$_singleton = $instance; } if (self::$_singleton === NULL) { $config = CRM_Core_Config::singleton(); $extMap = array(); $extMap['civicrm'] = $config->userFrameworkResourceURL; if (!empty($config->extensionsURL)) { $extMap['*'] = rtrim($config->extensionsURL, '/') . '/'; } self::$_singleton = new CRM_Core_Resources($extMap); } return self::$_singleton; }
/** * Get or set the single instance of CRM_Core_Resources. * * @param CRM_Core_Resources $instance * New copy of the manager. * @return CRM_Core_Resources */ public static function singleton(CRM_Core_Resources $instance = NULL) { if ($instance !== NULL) { self::$_singleton = $instance; } if (self::$_singleton === NULL) { $sys = CRM_Extension_System::singleton(); $cache = new CRM_Utils_Cache_SqlGroup(array('group' => 'js-strings', 'prefetch' => FALSE)); self::$_singleton = new CRM_Core_Resources($sys->getMapper(), $cache, CRM_Core_Config::isUpgradeMode() ? NULL : 'resCacheCode'); } return self::$_singleton; }
/** * Get or set the single instance of CRM_Core_Resources. * * @param CRM_Core_Resources $instance * New copy of the manager. * @return CRM_Core_Resources */ public static function singleton(CRM_Core_Resources $instance = NULL) { if ($instance !== NULL) { self::$_singleton = $instance; } if (self::$_singleton === NULL) { $sys = CRM_Extension_System::singleton(); $cache = Civi::cache('js_strings'); self::$_singleton = new CRM_Core_Resources($sys->getMapper(), $cache, CRM_Core_Config::isUpgradeMode() ? NULL : 'resCacheCode'); } return self::$_singleton; }