<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.7 |
+ | CiviCRM version 5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2017 |
+ | Copyright CiviCRM LLC (c) 2004-2018 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2017
+ * @copyright CiviCRM LLC (c) 2004-2018
* $Id$
*
*/
*/
public function set($key, &$value) {
if (!$this->_cache->set($this->_prefix . $key, serialize($value), $this->_timeout)) {
- CRM_Core_Error::fatal("Redis set failed, wondering why?, $key", $value);
+ if (PHP_SAPI === 'cli' || (Civi\Core\Container::isContainerBooted() && CRM_Core_Permission::check('view debug output'))) {
+ CRM_Core_Error::fatal("Redis set ($key) failed: " . $this->_cache->getLastError());
+ }
+ else {
+ Civi::log()->error("Redis set ($key) failed: " . $this->_cache->getLastError());
+ CRM_Core_Error::fatal("Redis set ($key) failed");
+ }
return FALSE;
}
return TRUE;