Mercurial > hg > isophonics-drupal-site
annotate core/lib/Drupal/Core/Lock/PersistentDatabaseLockBackend.php @ 13:5fb285c0d0e3
Update Drupal core to 8.4.7 via Composer. Security update; I *think* we've
been lucky to get away with this so far, as we don't support self-registration
which seems to be used by the so-called "drupalgeddon 2" attack that 8.4.5
was vulnerable to.
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:33:26 +0100 |
parents | 4c8ae668cc8c |
children |
rev | line source |
---|---|
Chris@0 | 1 <?php |
Chris@0 | 2 |
Chris@0 | 3 namespace Drupal\Core\Lock; |
Chris@0 | 4 |
Chris@0 | 5 use Drupal\Core\Database\Connection; |
Chris@0 | 6 |
Chris@0 | 7 /** |
Chris@0 | 8 * Defines the persistent database lock backend. This backend is global for this |
Chris@0 | 9 * Drupal installation. |
Chris@0 | 10 * |
Chris@0 | 11 * @ingroup lock |
Chris@0 | 12 */ |
Chris@0 | 13 class PersistentDatabaseLockBackend extends DatabaseLockBackend { |
Chris@0 | 14 |
Chris@0 | 15 /** |
Chris@0 | 16 * Constructs a new PersistentDatabaseLockBackend. |
Chris@0 | 17 * |
Chris@0 | 18 * @param \Drupal\Core\Database\Connection $database |
Chris@0 | 19 * The database connection. |
Chris@0 | 20 */ |
Chris@0 | 21 public function __construct(Connection $database) { |
Chris@0 | 22 // Do not call the parent constructor to avoid registering a shutdown |
Chris@0 | 23 // function that releases all the locks at the end of a request. |
Chris@0 | 24 $this->database = $database; |
Chris@0 | 25 // Set the lockId to a fixed string to make the lock ID the same across |
Chris@0 | 26 // multiple requests. The lock ID is used as a page token to relate all the |
Chris@0 | 27 // locks set during a request to each other. |
Chris@0 | 28 // @see \Drupal\Core\Lock\LockBackendInterface::getLockId() |
Chris@0 | 29 $this->lockId = 'persistent'; |
Chris@0 | 30 } |
Chris@0 | 31 |
Chris@0 | 32 } |