You are here

private function SettingsTrait::makeSettingsWritable in Automatic Updates 8.2

Ensures that settings.php is writable.

Parameters

string $drupal_root: The path of the Drupal root.

string $site: (optional) The name of the site whose settings should be made writable. Defaults to 'default'.

Return value

string The path to settings.php for the specified site.

1 call to SettingsTrait::makeSettingsWritable()
SettingsTrait::addSettings in tests/src/Traits/SettingsTrait.php
Appends some PHP code to settings.php.

File

tests/src/Traits/SettingsTrait.php, line 43

Class

SettingsTrait
Provides methods for manipulating site settings.

Namespace

Drupal\Tests\automatic_updates\Traits

Code

private function makeSettingsWritable(string $drupal_root, string $site = 'default') : string {
  $settings = implode(DIRECTORY_SEPARATOR, [
    $drupal_root,
    'sites',
    $site,
    'settings.php',
  ]);
  chmod(dirname($settings), 0744);
  chmod($settings, 0744);
  Assert::assertIsWritable($settings);
  return $settings;
}