X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FLock.php;h=31077138e65d87115425f309c8e66eaa362899c5;hb=8891c196ebd01aecfe5c0f2f3be70af4fdcb0adf;hp=0d175ce6fa0d7067f0fc3d8067774d170cb2f445;hpb=e22d01cd3d4016e392df7b0b76a713adffbb2b6d;p=civicrm-core.git diff --git a/CRM/Core/Lock.php b/CRM/Core/Lock.php index 0d175ce6fa..31077138e6 100644 --- a/CRM/Core/Lock.php +++ b/CRM/Core/Lock.php @@ -1,9 +1,9 @@ _hasLock) { - if (self::$jobLog && CRM_Core_DAO::singleValueQuery("SELECT IS_USED_LOCK( '" . self::$jobLog . "')")) { + if (!CRM_Utils_SQL::supportsMultipleLocks() && self::$jobLog && CRM_Core_DAO::singleValueQuery("SELECT IS_USED_LOCK( '" . self::$jobLog . "')")) { return $this->hackyHandleBrokenCode(self::$jobLog); } $query = "SELECT GET_LOCK( %1, %2 )"; - $params = array( - 1 => array($this->_id, 'String'), - 2 => array($timeout ? $timeout : $this->_timeout, 'Integer'), - ); + $params = [ + 1 => [$this->_id, 'String'], + 2 => [$timeout ? $timeout : $this->_timeout, 'Integer'], + ]; $res = CRM_Core_DAO::singleValueQuery($query, $params); if ($res) { if (defined('CIVICRM_LOCK_DEBUG')) { @@ -220,7 +225,7 @@ class CRM_Core_Lock implements \Civi\Core\Lock\LockInterface { } $query = "SELECT RELEASE_LOCK( %1 )"; - $params = array(1 => array($this->_id, 'String')); + $params = [1 => [$this->_id, 'String']]; return CRM_Core_DAO::singleValueQuery($query, $params); } } @@ -230,7 +235,7 @@ class CRM_Core_Lock implements \Civi\Core\Lock\LockInterface { */ public function isFree() { $query = "SELECT IS_FREE_LOCK( %1 )"; - $params = array(1 => array($this->_id, 'String')); + $params = [1 => [$this->_id, 'String']]; return CRM_Core_DAO::singleValueQuery($query, $params); }