function HtaccessWriter::defaultProtectedDirs

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/File/HtaccessWriter.php \Drupal\Core\File\HtaccessWriter::defaultProtectedDirs()
  2. 10 core/lib/Drupal/Core/File/HtaccessWriter.php \Drupal\Core\File\HtaccessWriter::defaultProtectedDirs()
  3. 11.x core/lib/Drupal/Core/File/HtaccessWriter.php \Drupal\Core\File\HtaccessWriter::defaultProtectedDirs()

Overrides HtaccessWriterInterface::defaultProtectedDirs

1 call to HtaccessWriter::defaultProtectedDirs()
HtaccessWriter::ensure in core/lib/Drupal/Core/File/HtaccessWriter.php
Creates a .htaccess file in each Drupal files directory if it is missing.

File

core/lib/Drupal/Core/File/HtaccessWriter.php, line 104

Class

HtaccessWriter
Provides functions to manage Apache .htaccess files.

Namespace

Drupal\Core\File

Code

public function defaultProtectedDirs() {
    $protected_dirs[] = new ProtectedDirectory('Public files directory', 'public://');
    if (PrivateStream::basePath()) {
        $protected_dirs[] = new ProtectedDirectory('Private files directory', 'private://', TRUE);
    }
    $protected_dirs[] = new ProtectedDirectory('Temporary files directory', 'temporary://');
    return $protected_dirs;
}

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