Patched to Drupal 8.4.8 level. See https://www.drupal.org/sa-core-2018-004 and patch...
[yaffs-website] / web / core / lib / Drupal / Core / Lock / PersistentDatabaseLockBackend.php
1 <?php
2
3 namespace Drupal\Core\Lock;
4
5 use Drupal\Core\Database\Connection;
6
7 /**
8  * Defines the persistent database lock backend. This backend is global for this
9  * Drupal installation.
10  *
11  * @ingroup lock
12  */
13 class PersistentDatabaseLockBackend extends DatabaseLockBackend {
14
15   /**
16    * Constructs a new PersistentDatabaseLockBackend.
17    *
18    * @param \Drupal\Core\Database\Connection $database
19    *   The database connection.
20    */
21   public function __construct(Connection $database) {
22     // Do not call the parent constructor to avoid registering a shutdown
23     // function that releases all the locks at the end of a request.
24     $this->database = $database;
25     // Set the lockId to a fixed string to make the lock ID the same across
26     // multiple requests. The lock ID is used as a page token to relate all the
27     // locks set during a request to each other.
28     // @see \Drupal\Core\Lock\LockBackendInterface::getLockId()
29     $this->lockId = 'persistent';
30   }
31
32 }