function DiskSpaceValidator::stat

Wrapper around the stat() function.

Parameters

string $path: The path to check.

Return value

mixed[] The statistics for the path.

Throws

\RuntimeException If the statistics could not be determined.

1 call to DiskSpaceValidator::stat()
DiskSpaceValidator::areSameLogicalDisk in core/modules/package_manager/src/Validator/DiskSpaceValidator.php
Checks if two paths are located on the same logical disk.

File

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

Class

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

Namespace

Drupal\package_manager\Validator

Code

protected function stat(string $path) : array {
    $stat = stat($path);
    if ($stat === FALSE) {
        throw new \RuntimeException("Cannot get information for {$path}.");
    }
    return $stat;
}

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