function FileSystem::chmod

Same name in other branches
  1. 9 core/lib/Drupal/Core/File/FileSystem.php \Drupal\Core\File\FileSystem::chmod()
  2. 8.9.x core/lib/Drupal/Core/File/FileSystem.php \Drupal\Core\File\FileSystem::chmod()
  3. 11.x core/lib/Drupal/Core/File/FileSystem.php \Drupal\Core\File\FileSystem::chmod()
3 calls to FileSystem::chmod()
FileSystem::copy in core/lib/Drupal/Core/File/FileSystem.php
FileSystem::move in core/lib/Drupal/Core/File/FileSystem.php
FileSystem::prepareDirectory in core/lib/Drupal/Core/File/FileSystem.php

File

core/lib/Drupal/Core/File/FileSystem.php, line 94

Class

FileSystem
Provides helpers to operate on files and stream wrappers.

Namespace

Drupal\Core\File

Code

public function chmod($uri, $mode = NULL) {
    if (!isset($mode)) {
        if (is_dir($uri)) {
            $mode = $this->settings
                ->get('file_chmod_directory', static::CHMOD_DIRECTORY);
        }
        else {
            $mode = $this->settings
                ->get('file_chmod_file', static::CHMOD_FILE);
        }
    }
    return @chmod($uri, $mode);
}

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