SECURITY: Create a .htaccess in /vendor after composer runs
authorKunal Mehta <legoktm@member.fsf.org>
Sat, 11 Nov 2017 00:05:13 +0000 (16:05 -0800)
committerReedy <reedy@wikimedia.org>
Wed, 15 Nov 2017 02:54:30 +0000 (02:54 +0000)
commit87e109a360ce9cf069ad991d70920949ab7863ee
tree03a14f7375221ab187574d27f6a7583ac6fe5e84
parent410c00a9ae92411d3d1568e84c4aa2579a577635
SECURITY: Create a .htaccess in /vendor after composer runs

The /vendor directory does not need to be web accessible, and to reduce
attack surface, it should not be web accessible. We can use the
post-install-cmd and post-update-cmd hooks to create a .htaccess after
the user has run "composer install" or "composer update". On the first
run of composer, this hook will be invoked twice due to the composer
merge plugin.

If the htaccess file already exists, this hook won't do anything.

Bug: T180237
Change-Id: I2cf6541750c90b5708d7cf5f81b914ae2d9d46d1
composer.json
includes/composer/ComposerVendorHtaccessCreator.php [new file with mode: 0644]