X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCxn%2FCiviCxnHttp.php;h=f8acdb9704322a09d78b7654508c1ce11f93732e;hb=85a1be13f794b5f9380ed7bdab978ca3b656ef69;hp=0d6024812cc0c40441ab0acd4a49dd157eedf06c;hpb=c66b6cb99f4b9013cd1c77a87b44da9525fe6502;p=civicrm-core.git diff --git a/CRM/Cxn/CiviCxnHttp.php b/CRM/Cxn/CiviCxnHttp.php index 0d6024812c..f8acdb9704 100644 --- a/CRM/Cxn/CiviCxnHttp.php +++ b/CRM/Cxn/CiviCxnHttp.php @@ -22,11 +22,11 @@ class CRM_Cxn_CiviCxnHttp extends \Civi\Cxn\Rpc\Http\PhpHttp { */ public static function singleton($fresh = FALSE) { if (self::$singleton === NULL || $fresh) { - $cache = CRM_Utils_Cache::create(array( + $cache = CRM_Utils_Cache::create([ 'name' => 'CiviCxnHttp', - 'type' => Civi::settings()->get('debug_enabled') ? 'ArrayCache' : array('SqlGroup', 'ArrayCache'), + 'type' => Civi::settings()->get('debug_enabled') ? 'ArrayCache' : ['SqlGroup', 'ArrayCache'], 'prefetch' => FALSE, - )); + ]); self::$singleton = new CRM_Cxn_CiviCxnHttp($cache); } @@ -50,7 +50,7 @@ class CRM_Cxn_CiviCxnHttp extends \Civi\Cxn\Rpc\Http\PhpHttp { * @return array * array($headers, $blob, $code) */ - public function send($verb, $url, $blob, $headers = array()) { + public function send($verb, $url, $blob, $headers = []) { $lowVerb = strtolower($verb); if ($lowVerb === 'get' && $this->cache) { @@ -67,11 +67,11 @@ class CRM_Cxn_CiviCxnHttp extends \Civi\Cxn\Rpc\Http\PhpHttp { $expires = CRM_Utils_Http::parseExpiration($result[0]); if ($expires !== NULL) { $cachePath = 'get_' . md5($url); - $cacheLine = array( + $cacheLine = [ 'url' => $url, 'expires' => $expires, 'data' => $result, - ); + ]; $this->cache->set($cachePath, $cacheLine); } } @@ -93,9 +93,9 @@ class CRM_Cxn_CiviCxnHttp extends \Civi\Cxn\Rpc\Http\PhpHttp { protected function createStreamOpts($verb, $url, $blob, $headers) { $result = parent::createStreamOpts($verb, $url, $blob, $headers); - $caConfig = CA_Config_Stream::probe(array( + $caConfig = CA_Config_Stream::probe([ 'verify_peer' => (bool) Civi::settings()->get('verifySSL'), - )); + ]); if ($caConfig->isEnableSSL()) { $result['ssl'] = $caConfig->toStreamOptions(); }