function SandboxManagerBase::getSandboxDirectory

Same name and namespace in other branches
  1. 11.x core/modules/package_manager/src/SandboxManagerBase.php \Drupal\package_manager\SandboxManagerBase::getSandboxDirectory()

Returns the path of the directory where changes should be staged.

Return value

string The absolute path of the directory where changes should be staged. If this sandbox manager is operating in direct-write mode, this will be path of the active directory.

4 calls to SandboxManagerBase::getSandboxDirectory()
SandboxManagerBase::apply in core/modules/package_manager/src/SandboxManagerBase.php
Applies staged changes to the active directory.
SandboxManagerBase::create in core/modules/package_manager/src/SandboxManagerBase.php
Copies the active code base into the stage directory.
SandboxManagerBase::require in core/modules/package_manager/src/SandboxManagerBase.php
Adds or updates packages in the sandbox directory.
SandboxManagerBase::sandboxDirectoryExists in core/modules/package_manager/src/SandboxManagerBase.php
Determines if there is an active sandbox with a directory on disk.

File

core/modules/package_manager/src/SandboxManagerBase.php, line 761

Class

SandboxManagerBase
Creates and manages a sandbox directory in which to install or update code.

Namespace

Drupal\package_manager

Code

public function getSandboxDirectory() : string {
  if ($this->isDirectWrite()) {
    return $this->pathLocator
      ->getProjectRoot();
  }
  return $this->getStagingRoot() . DIRECTORY_SEPARATOR . self::COMPOSER_SANDBOX_DIRECTORY;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.