comparison core/lib/Drupal/Core/Lock/PersistentDatabaseLockBackend.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
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 }