public function Updater::makeWorldReadable

Ensures that a given directory is world readable.

Parameters

Drupal\Core\FileTransfer\FileTransferInterface $filetransfer: Object which is a child of FileTransfer.

string $path: The file path to make world readable.

bool $recursive: If the chmod should be applied recursively.

3 calls to Updater::makeWorldReadable()
Updater::install in drupal/core/lib/Drupal/Core/Updater/Updater.php
Installs a Drupal project, returns a list of next actions.
Updater::prepareInstallDirectory in drupal/core/lib/Drupal/Core/Updater/Updater.php
Makes sure the installation parent directory exists and is writable.
Updater::update in drupal/core/lib/Drupal/Core/Updater/Updater.php
Updates a Drupal project and returns a list of next actions.

File

drupal/core/lib/Drupal/Core/Updater/Updater.php, line 320
Definition of Drupal\Core\Updater\Updater.

Class

Updater
Defines the base class for Updaters used in Drupal.

Namespace

Drupal\Core\Updater

Code

public function makeWorldReadable(&$filetransfer, $path, $recursive = TRUE) {
  if (!is_executable($path)) {

    // Set it to read + execute.
    $new_perms = substr(sprintf('%o', fileperms($path)), -4, -1) . "5";
    $filetransfer
      ->chmod($path, intval($new_perms, 8), $recursive);
  }
}