function DiskSpaceValidator::areSameLogicalDisk

Checks if two paths are located on the same logical disk.

Parameters

string $root: The path of the project root.

string $vendor: The path of the vendor directory.

Return value

bool TRUE if the project root and vendor directory are on the same logical disk, FALSE otherwise.

1 call to DiskSpaceValidator::areSameLogicalDisk()
DiskSpaceValidator::validate in core/modules/package_manager/src/Validator/DiskSpaceValidator.php
Validates that there is enough free disk space to do stage operations.

File

core/modules/package_manager/src/Validator/DiskSpaceValidator.php, line 82

Class

DiskSpaceValidator
Validates that there is enough free disk space to do stage operations.

Namespace

Drupal\package_manager\Validator

Code

protected function areSameLogicalDisk(string $root, string $vendor) : bool {
    $root_statistics = $this->stat($root);
    $vendor_statistics = $this->stat($vendor);
    return $root_statistics['dev'] === $vendor_statistics['dev'];
}

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