file_ensure_htaccess

  1. drupal
    1. 7
Versions
7 file_ensure_htaccess()

If missing, create a .htaccess file in each Drupal files directory.

Related topics

▾ 1 function calls file_ensure_htaccess()

file_unmanaged_copy in drupal/includes/file.inc
Copies a file to a new location without invoking the file API.

Code

drupal/includes/file.inc, line 465

<?php
function file_ensure_htaccess() {
  file_create_htaccess('public://', FALSE);
  if (variable_get('file_private_path', FALSE)) {
    file_create_htaccess('private://', TRUE);
  }
  file_create_htaccess('temporary://', TRUE);
}
?>