function Updater::makeWorldReadable

Same name in other branches
  1. 7.x includes/updater.inc \Updater::makeWorldReadable()
  2. 9 core/lib/Drupal/Core/Updater/Updater.php \Drupal\Core\Updater\Updater::makeWorldReadable()
  3. 8.9.x core/lib/Drupal/Core/Updater/Updater.php \Drupal\Core\Updater\Updater::makeWorldReadable()
  4. 11.x core/lib/Drupal/Core/Updater/Updater.php \Drupal\Core\Updater\Updater::makeWorldReadable()

Ensures that a given directory is world readable.

Parameters

\Drupal\Core\FileTransfer\FileTransfer $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 core/lib/Drupal/Core/Updater/Updater.php
Installs a Drupal project, returns a list of next actions.
Updater::prepareInstallDirectory in core/lib/Drupal/Core/Updater/Updater.php
Makes sure the installation parent directory exists and is writable.
Updater::update in core/lib/Drupal/Core/Updater/Updater.php
Updates a Drupal project and returns a list of next actions.

File

core/lib/Drupal/Core/Updater/Updater.php, line 372

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 = fileperms($path) & 0777 | 05;
        $filetransfer->chmod($path, $new_perms, $recursive);
    }
}

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