function Updater::makeWorldReadable

Same name in other branches
  1. 9 core/lib/Drupal/Core/Updater/Updater.php \Drupal\Core\Updater\Updater::makeWorldReadable()
  2. 8.9.x core/lib/Drupal/Core/Updater/Updater.php \Drupal\Core\Updater\Updater::makeWorldReadable()
  3. 10 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()

Ensure that a given directory is world readable.

Parameters

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 includes/updater.inc
Installs a Drupal project, returns a list of next actions.
Updater::prepareInstallDirectory in includes/updater.inc
Make sure the installation parent directory exists and is writable.
Updater::update in includes/updater.inc
Updates a Drupal project, returns a list of next actions.

File

includes/updater.inc, line 363

Class

Updater
Base class for Updaters used in Drupal.

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);
    }
}

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