HtaccessWriter
class HtaccessWriter implements HtaccessWriterInterface (View source)
Provides functions to manage Apache .htaccess files.
Properties
| protected StreamWrapperManagerInterface | $streamWrapperManager | The stream wrapper manager. |
|
| protected LoggerInterface | $logger | The logger. |
Methods
__construct(LoggerInterface $logger, StreamWrapperManagerInterface $stream_wrapper_manager)
Htaccess constructor.
ensure()
Creates a .htaccess file in each Drupal files directory if it is missing.
bool
write(string $directory, bool $deny_public_access = TRUE, bool $force_overwrite = FALSE)
Creates a .htaccess file in the given directory.
defaultProtectedDirs()
Returns a list of the default protected directories.
Details
__construct(LoggerInterface $logger, StreamWrapperManagerInterface $stream_wrapper_manager)
Htaccess constructor.
ensure()
Creates a .htaccess file in each Drupal files directory if it is missing.
bool
write(string $directory, bool $deny_public_access = TRUE, bool $force_overwrite = FALSE)
| internal |
Creates a .htaccess file in the given directory.
ProtectedDirectory[]
defaultProtectedDirs()
Returns a list of the default protected directories.