You are here

public static function FileSecurity::writeWebConfig in Drupal 8

Same name in this branch
  1. 8 composer/Plugin/VendorHardening/FileSecurity.php \Drupal\Composer\Plugin\VendorHardening\FileSecurity::writeWebConfig()
  2. 8 core/lib/Drupal/Component/FileSecurity/FileSecurity.php \Drupal\Component\FileSecurity\FileSecurity::writeWebConfig()
Same name and namespace in other branches
  1. 9 composer/Plugin/VendorHardening/FileSecurity.php \Drupal\Composer\Plugin\VendorHardening\FileSecurity::writeWebConfig()
  2. 10 composer/Plugin/VendorHardening/FileSecurity.php \Drupal\Composer\Plugin\VendorHardening\FileSecurity::writeWebConfig()

Writes a web.config file in the given directory, if it doesn't exist.

Parameters

string $directory: The directory.

bool $force: (optional) Set to TRUE to force overwrite an existing file.

Return value

bool TRUE if the file already exists or was created. FALSE otherwise.

1 call to FileSecurity::writeWebConfig()
VendorHardeningPlugin::writeAccessRestrictionFiles in composer/Plugin/VendorHardening/VendorHardeningPlugin.php
Place .htaccess and web.config files into the vendor directory.

File

composer/Plugin/VendorHardening/FileSecurity.php, line 114

Class

FileSecurity
Provides file security functions.

Namespace

Drupal\Composer\Plugin\VendorHardening

Code

public static function writeWebConfig($directory, $force = FALSE) {
  return self::writeFile($directory, 'web.config', self::webConfigLines(), $force);
}