projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dev/core#1317 - Fix total_amount on repeattransaction when tax amount is involved.
[civicrm-core.git]
/
CRM
/
Core
/
Lock.php
diff --git
a/CRM/Core/Lock.php
b/CRM/Core/Lock.php
index 40b94ae7b162f6f76c695a667eba26d9c4fd32b6..31077138e65d87115425f309c8e66eaa362899c5 100644
(file)
--- a/
CRM/Core/Lock.php
+++ b/
CRM/Core/Lock.php
@@
-44,11
+44,16
@@
class CRM_Core_Lock implements \Civi\Core\Lock\LockInterface {
*
* @var bool
*/
*
* @var bool
*/
- static $jobLog = FALSE;
+
public
static $jobLog = FALSE;
- // lets have a 3 second timeout for now
+ /**
+ * lets have a 3 second timeout for now
+ */
const TIMEOUT = 3;
const TIMEOUT = 3;
+ /**
+ * @var bool
+ */
protected $_hasLock = FALSE;
protected $_name;
protected $_hasLock = FALSE;
protected $_name;
@@
-177,15
+182,15
@@
class CRM_Core_Lock implements \Civi\Core\Lock\LockInterface {
*/
public function acquire($timeout = NULL) {
if (!$this->_hasLock) {
*/
public function acquire($timeout = NULL) {
if (!$this->_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 )";
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')) {
$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 )";
}
$query = "SELECT RELEASE_LOCK( %1 )";
- $params =
array(1 => array($this->_id, 'String'))
;
+ $params =
[1 => [$this->_id, 'String']]
;
return CRM_Core_DAO::singleValueQuery($query, $params);
}
}
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 )";
*/
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);
}
return CRM_Core_DAO::singleValueQuery($query, $params);
}