diff --git a/cache/upgrade.txt b/cache/upgrade.txt index 768f66716ac..f367cad72b3 100644 --- a/cache/upgrade.txt +++ b/cache/upgrade.txt @@ -3,6 +3,8 @@ Information provided here is intended especially for developers. === 4.0 === * The function supports_recursion() from the lock_factory interface has been deprecated including the related implementations. +* The function extend_lock() from the lock_factory interface has been deprecated without replacement including the related + implementations. === 3.9 === * The record_cache_hit/miss/set methods now take a cache_store instead of a cache_definition object diff --git a/lib/classes/lock/db_record_lock_factory.php b/lib/classes/lock/db_record_lock_factory.php index 11ec1a187a2..4dfec49c4de 100644 --- a/lib/classes/lock/db_record_lock_factory.php +++ b/lib/classes/lock/db_record_lock_factory.php @@ -191,11 +191,16 @@ class db_record_lock_factory implements lock_factory { /** * Extend a lock that was previously obtained with @lock. + * + * @deprecated since Moodle 4.0. * @param lock $lock - a lock obtained from this factory. * @param int $maxlifetime - the new lifetime for the lock (in seconds). * @return boolean - true if the lock was extended. */ public function extend_lock(lock $lock, $maxlifetime = 86400) { + debugging('The function extend_lock() is deprecated, please do not use it anymore.', + DEBUG_DEVELOPER); + $now = time(); $expires = $now + $maxlifetime; $params = array('expires' => $expires, diff --git a/lib/classes/lock/file_lock_factory.php b/lib/classes/lock/file_lock_factory.php index d719cd9112c..b7716399007 100644 --- a/lib/classes/lock/file_lock_factory.php +++ b/lib/classes/lock/file_lock_factory.php @@ -192,11 +192,15 @@ class file_lock_factory implements lock_factory { /** * Extend a lock that was previously obtained with @lock. + * + * @deprecated since Moodle 4.0. * @param lock $lock - not used * @param int $maxlifetime - not used * @return boolean - true if the lock was extended. */ public function extend_lock(lock $lock, $maxlifetime = 86400) { + debugging('The function extend_lock() is deprecated, please do not use it anymore.', + DEBUG_DEVELOPER); // Not supported by this factory. return false; } diff --git a/lib/classes/lock/installation_lock_factory.php b/lib/classes/lock/installation_lock_factory.php index 36ebdd951d1..0874cedc610 100644 --- a/lib/classes/lock/installation_lock_factory.php +++ b/lib/classes/lock/installation_lock_factory.php @@ -118,11 +118,14 @@ class installation_lock_factory implements lock_factory { /** * Extend a lock that was previously obtained with @lock. * + * @deprecated since Moodle 4.0. * @param lock $lock - not used * @param int $maxlifetime - not used * @return boolean - true if the lock was extended. */ public function extend_lock(lock $lock, $maxlifetime = 86400) { + debugging('The function extend_lock() is deprecated, please do not use it anymore.', + DEBUG_DEVELOPER); // Not supported by this factory. return false; } diff --git a/lib/classes/lock/lock_factory.php b/lib/classes/lock/lock_factory.php index 9d3303e0e2a..c0d32b0a1ff 100644 --- a/lib/classes/lock/lock_factory.php +++ b/lib/classes/lock/lock_factory.php @@ -99,6 +99,7 @@ interface lock_factory { /** * Extend the timeout on a held lock. * + * @deprecated since Moodle 4.0. * @param lock $lock - lock obtained from this factory * @param int $maxlifetime - new max time to hold the lock * @return boolean - True if the lock was extended. diff --git a/lib/classes/lock/mysql_lock_factory.php b/lib/classes/lock/mysql_lock_factory.php index 5efb2927732..753741b4655 100644 --- a/lib/classes/lock/mysql_lock_factory.php +++ b/lib/classes/lock/mysql_lock_factory.php @@ -168,11 +168,15 @@ class mysql_lock_factory implements lock_factory { /** * Extend a lock that was previously obtained with @lock. + * + * @deprecated since Moodle 4.0. * @param lock $lock - a lock obtained from this factory. * @param int $maxlifetime - the new lifetime for the lock (in seconds). * @return boolean - true if the lock was extended. */ public function extend_lock(lock $lock, $maxlifetime = 86400) { + debugging('The function extend_lock() is deprecated, please do not use it anymore.', + DEBUG_DEVELOPER); // Not supported by this factory. return false; } diff --git a/lib/classes/lock/postgres_lock_factory.php b/lib/classes/lock/postgres_lock_factory.php index c100acb934c..1d2ccf6159e 100644 --- a/lib/classes/lock/postgres_lock_factory.php +++ b/lib/classes/lock/postgres_lock_factory.php @@ -198,11 +198,15 @@ class postgres_lock_factory implements lock_factory { /** * Extend a lock that was previously obtained with @lock. + * + * @deprecated since Moodle 4.0. * @param lock $lock - a lock obtained from this factory. * @param int $maxlifetime - the new lifetime for the lock (in seconds). * @return boolean - true if the lock was extended. */ public function extend_lock(lock $lock, $maxlifetime = 86400) { + debugging('The function extend_lock() is deprecated, please do not use it anymore.', + DEBUG_DEVELOPER); // Not supported by this factory. return false; }