Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. VendorHardeningPlugin.php

function VendorHardeningPlugin::writeAccessRestrictionFiles

Place .htaccess file into the vendor directory.

Parameters

string $vendor_dir: Path to vendor directory.

1 call to VendorHardeningPlugin::writeAccessRestrictionFiles()
VendorHardeningPlugin::onPostAutoloadDump in composer/Plugin/VendorHardening/VendorHardeningPlugin.php
POST_AUTOLOAD_DUMP event handler.

File

composer/Plugin/VendorHardening/VendorHardeningPlugin.php, line 378

Class

VendorHardeningPlugin
A Composer plugin to clean out your project's vendor directory.

Namespace

Drupal\Composer\Plugin\VendorHardening

Code

public function writeAccessRestrictionFiles(string $vendor_dir) : void {
    $this->io
        ->writeError('<info>Hardening vendor directory with .htaccess file.</info>');
    // Prevent access to vendor directory on Apache servers.
    FileSecurity::writeHtaccess($vendor_dir, TRUE);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal