You are here

protected function InPlaceUpdate::getProjectRealPath in Automatic Updates 8

Get the real path of a file.

Parameters

string $file_path: The file path.

string $project_root: The project root directory.

Return value

string The real path of a file.

4 calls to InPlaceUpdate::getProjectRealPath()
InPlaceUpdate::doBackup in src/Services/InPlaceUpdate.php
Execute file backup.
InPlaceUpdate::doRestore in src/Services/InPlaceUpdate.php
Do restore.
InPlaceUpdate::processUpdate in src/Services/InPlaceUpdate.php
Process update.
InPlaceUpdate::rollback in src/Services/InPlaceUpdate.php
Rollback after a failed update.

File

src/Services/InPlaceUpdate.php, line 580

Class

InPlaceUpdate
Class to apply in-place updates.

Namespace

Drupal\automatic_updates\Services

Code

protected function getProjectRealPath($file_path, $project_root) {
  if (strpos($file_path, 'vendor' . DIRECTORY_SEPARATOR) === 0) {
    return $this->vendorPath . substr($file_path, 7);
  }
  return rtrim($project_root, '/\\') . DIRECTORY_SEPARATOR . $file_path;
}