function file_htaccess_lines

Same name in other branches
  1. 7.x includes/file.inc \file_htaccess_lines()

Returns the standard .htaccess lines that Drupal writes to file directories.

Parameters

bool $private: (Optional) Set to FALSE to return the .htaccess lines for a web-accessible public directory. The default is TRUE, which returns the .htaccess lines for a private directory that should not be web-accessible.

Return value

string The desired contents of the .htaccess file.

Deprecated

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Component\FileSecurity\FileSecurity::htaccessLines().

See also

https://www.drupal.org/node/2418133

Related topics

File

core/includes/file.inc, line 379

Code

function file_htaccess_lines($private = TRUE) {
    return FileSecurity::htaccessLines($private);
}

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