/** * Provide a singleton instance to simplify integration. If you prefer * to manage the lifecycle of the config object, then consider using * "probe()" or "new" instead. * * @return CA_Config_Stream */ public static function singleton() { if (!self::$_singleton) { global $CA_CONFIG; self::$_singleton = self::probe($CA_CONFIG ? $CA_CONFIG : array()); } return self::$_singleton; }
protected function createStreamOpts($verb, $url, $blob, $headers) { $result = parent::createStreamOpts($verb, $url, $blob, $headers); $caConfig = CA_Config_Stream::probe(array('verify_peer' => (bool) Civi::settings()->get('verifySSL'))); if ($caConfig->isEnableSSL()) { $result['ssl'] = $caConfig->toStreamOptions(); } if (!$caConfig->isEnableSSL() && preg_match('/^https:/', $url)) { CRM_Core_Error::fatal('Cannot fetch document - system does not support SSL'); } return $result; }
protected function createStreamOpts($verb, $url, $blob, $headers) { $result = parent::createStreamOpts($verb, $url, $blob, $headers); $caConfig = CA_Config_Stream::probe(array('verify_peer' => (bool) CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'verifySSL', NULL, TRUE))); if ($caConfig->isEnableSSL()) { $result['ssl'] = $caConfig->toStreamOptions(); } if (!$caConfig->isEnableSSL() && preg_match('/^https:/', $url)) { CRM_Core_Error::fatal('Cannot fetch document - system does not support SSL'); } return $result; }