You are here

protected function ReadOnlyFilesystem::readOnlyCheck in Automatic Updates 8

Check if the filesystem is read only.

Return value

array An array of translatable strings if any checks fail.

1 call to ReadOnlyFilesystem::readOnlyCheck()
ReadOnlyFilesystem::doCheck in src/ReadinessChecker/ReadOnlyFilesystem.php
Perform checks.

File

src/ReadinessChecker/ReadOnlyFilesystem.php, line 58

Class

ReadOnlyFilesystem
Read only filesystem checker.

Namespace

Drupal\automatic_updates\ReadinessChecker

Code

protected function readOnlyCheck() {
  $messages = [];
  if ($this
    ->areSameLogicalDisk($this
    ->getRootPath(), $this
    ->getVendorPath())) {
    $error = $this
      ->t('Logical disk at "@path" is read only. Updates to Drupal cannot be applied against a read only file system.', [
      '@path' => $this->rootPath,
    ]);
    $this
      ->doReadOnlyCheck($this
      ->getRootPath(), 'core/core.api.php', $messages, $error);
  }
  else {
    $error = $this
      ->t('Drupal core filesystem at "@path" is read only. Updates to Drupal core cannot be applied against a read only file system.', [
      '@path' => $this->rootPath . '/core',
    ]);
    $this
      ->doReadOnlyCheck($this
      ->getRootPath(), implode(DIRECTORY_SEPARATOR, [
      'core',
      'core.api.php',
    ]), $messages, $error);
    $error = $this
      ->t('Vendor filesystem at "@path" is read only. Updates to the site\'s code base cannot be applied against a read only file system.', [
      '@path' => $this->vendorPath,
    ]);
    $this
      ->doReadOnlyCheck($this
      ->getVendorPath(), 'composer/LICENSE', $messages, $error);
  }
  return $messages;
}