public function Updater::makeWorldReadable

7.x updater.inc public Updater::makeWorldReadable(&$filetransfer, $path, $recursive = TRUE)

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

File

drupal-7.x/includes/updater.inc, line 353
Classes used for updating various files in the Drupal webroot. These classes use a FileTransfer object to actually perform the operations. Normally, the FileTransfer is provided when the site owner is redirected to authorize.php as part of a multistep…

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