Skip to content
Snippets Groups Projects

Issue #3266092: Make sure staging root is unique for each Drupal site

Merged Issue #3266092: Make sure staging root is unique for each Drupal site
All threads resolved!
All threads resolved!
7 files
+ 35
32
Compare changes
  • Side-by-side
  • Inline
Files
7
@@ -72,7 +72,7 @@ class Stage {
@@ -72,7 +72,7 @@ class Stage {
*
*
* @var \Drupal\Core\Config\ConfigFactoryInterface
* @var \Drupal\Core\Config\ConfigFactoryInterface
*/
*/
protected static $configFactory;
protected $configFactory;
/**
/**
* The path locator service.
* The path locator service.
@@ -162,7 +162,7 @@ class Stage {
@@ -162,7 +162,7 @@ class Stage {
* The time service.
* The time service.
*/
*/
public function __construct(ConfigFactoryInterface $config_factory, PathLocator $path_locator, BeginnerInterface $beginner, StagerInterface $stager, CommitterInterface $committer, FileSystemInterface $file_system, EventDispatcherInterface $event_dispatcher, SharedTempStoreFactory $shared_tempstore, TimeInterface $time) {
public function __construct(ConfigFactoryInterface $config_factory, PathLocator $path_locator, BeginnerInterface $beginner, StagerInterface $stager, CommitterInterface $committer, FileSystemInterface $file_system, EventDispatcherInterface $event_dispatcher, SharedTempStoreFactory $shared_tempstore, TimeInterface $time) {
self::$configFactory = $config_factory;
$this->configFactory = $config_factory;
$this->pathLocator = $path_locator;
$this->pathLocator = $path_locator;
$this->beginner = $beginner;
$this->beginner = $beginner;
$this->stager = $stager;
$this->stager = $stager;
@@ -512,4+512,4 @@
@@ -512,4+512,4 @@
*
*
* @todo Make this method public in https://www.drupal.org/i/3251972.
* @todo Make this method public in https://www.drupal.org/i/3251972.
*/
*/
public function getStageDirectory(): string {
public function getStageDirectory(): string {
if (!$this->lock) {
if (!$this->lock) {
throw new \LogicException(__METHOD__ . '() cannot be called because the stage has not been created or claimed.');
throw new \LogicException(__METHOD__ . '() cannot be called because the stage has not been created or claimed.');
}
}
return static::getStagingRoot() . DIRECTORY_SEPARATOR . $this->lock[0];
return $this->getStagingRoot() . DIRECTORY_SEPARATOR . $this->lock[0];
}
}
/**
/**
@@ -526,8 +526,8 @@ class Stage {
@@ -526,8 +526,8 @@ class Stage {
* The absolute path of the directory containing the staging areas managed
* The absolute path of the directory containing the staging areas managed
* by this class.
* by this class.
*/
*/
protected static function getStagingRoot(): string {
protected function getStagingRoot(): string {
$site_id = self::$configFactory->get('system.site')->get('uuid');
$site_id = $this->configFactory->get('system.site')->get('uuid');
return FileSystem::getOsTemporaryDirectory() . DIRECTORY_SEPARATOR . '.package_manager' . $site_id;
return FileSystem::getOsTemporaryDirectory() . DIRECTORY_SEPARATOR . '.package_manager' . $site_id;
}
}
Loading