commit 6f8bad0f624a4c03508d3ce15b473b0b3adb00b7 Author: Erik Stielstra Date: Fri Feb 14 13:47:17 2014 +0100 #10 diff --git a/core/lib/Drupal/Core/Config/ConfigImporter.php b/core/lib/Drupal/Core/Config/ConfigImporter.php index 8bbc7a4..0c7e524 100644 --- a/core/lib/Drupal/Core/Config/ConfigImporter.php +++ b/core/lib/Drupal/Core/Config/ConfigImporter.php @@ -35,7 +35,7 @@ class ConfigImporter { /** * The name used to identify the lock. */ - const LOCKID = 'config_importer'; + const LOCK_ID = 'config_importer'; /** * The storage comparer used to discover configuration changes. @@ -201,9 +201,9 @@ public function import() { // Ensure that the changes have been validated. $this->validate(); - if (!$this->lock->acquire(static::LOCKID)) { + if (!$this->lock->acquire(static::LOCK_ID)) { // Another process is synchronizing configuration. - throw new ConfigImporterException(sprintf('%s is already importing', static::LOCKID)); + throw new ConfigImporterException(sprintf('%s is already importing', static::LOCK_ID)); } $this->importInvokeOwner(); $this->importConfig(); @@ -212,7 +212,7 @@ public function import() { // The import is now complete. - $this->lock->release(static::LOCKID); + $this->lock->release(static::LOCK_ID); $this->reset(); } return $this; @@ -302,17 +302,7 @@ protected function importInvokeOwner() { * TRUE if an import is already running, FALSE if not. */ public function alreadyImporting() { - return !$this->lock->lockMayBeAvailable(static::LOCKID); - } - - /** - * Returns the lock identifier. - * - * @return string - * The identifier for locks. - */ - public function getLockId() { - return static::LOCKID; + return !$this->lock->lockMayBeAvailable(static::LOCK_ID); } } diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php index d6f5ecb..72cc853 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php @@ -101,8 +101,8 @@ function testImportLock() { $this->assertNoText(t('There are no configuration changes.')); // Acquire a fake-lock on the import mechanism. - $config_importer_lock = $this->configImporter()->getLockId(); - $this->container->get('lock')->acquire($config_importer_lock); + $config_importer = $this->configImporter(); + $this->container->get('lock')->acquire($config_importer::LOCK_ID); // Attempt to import configuration and verify that an error message appears. $this->drupalPostForm(NULL, array(), t('Import all'));