X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FLock.php;h=215d39490a7f0b4203d99c8f031c01756c9d78ae;hb=553ffa22464ff37a28a070458bcd52097b54235f;hp=87c267b01d92d1d21ecb474d2177fdd2be376d32;hpb=898f38ad65fe945087a16062f22c66bdf9e36e77;p=civicrm-core.git diff --git a/CRM/Core/Lock.php b/CRM/Core/Lock.php index 87c267b01d..215d39490a 100644 --- a/CRM/Core/Lock.php +++ b/CRM/Core/Lock.php @@ -1,7 +1,7 @@ dsn); $database = $dsnArray['database']; @@ -80,14 +83,14 @@ class CRM_Core_Lock { $this->acquire(); } - function __destruct() { + public function __destruct() { $this->release(); } /** * @return bool */ - function acquire() { + public function acquire() { if (defined('CIVICRM_LOCK_DEBUG')) { CRM_Core_Error::debug_log_message('acquire lock for ' . $this->_name); } @@ -108,7 +111,7 @@ class CRM_Core_Lock { /** * @return null|string */ - function release() { + public function release() { if ($this->_hasLock) { $this->_hasLock = FALSE; @@ -121,7 +124,7 @@ class CRM_Core_Lock { /** * @return null|string */ - function isFree() { + public function isFree() { $query = "SELECT IS_FREE_LOCK( %1 )"; $params = array(1 => array($this->_name, 'String')); return CRM_Core_DAO::singleValueQuery($query, $params); @@ -130,7 +133,7 @@ class CRM_Core_Lock { /** * @return bool */ - function isAcquired() { + public function isAcquired() { return $this->_hasLock; } @@ -145,9 +148,9 @@ class CRM_Core_Lock { * * @param string $jobLog * @throws CRM_Core_Exception - * @return boolean + * @return bool */ - function hackyHandleBrokenCode($jobLog) { + public function hackyHandleBrokenCode($jobLog) { if (stristr($this->_name, 'job')) { throw new CRM_Core_Exception('lock aquisition for ' . $this->_name . 'attempted when ' . $jobLog . 'is not released'); } @@ -157,5 +160,5 @@ class CRM_Core_Lock { $this->_hasLock = TRUE; return TRUE; } -} +}