Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F6030390
ComposerVendorHtaccessCreator.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
689 B
Referenced Files
None
Subscribers
None
ComposerVendorHtaccessCreator.php
View Options
<?php
/**
* Copyright (C) 2017 Kunal Mehta <legoktm@debian.org>
*
* @license GPL-2.0-or-later
*/
namespace
MediaWiki\Composer
;
/**
* Creates a .htaccess in the vendor/ directory
* to prevent web access.
*
* This class runs *outside* of the normal MediaWiki
* environment and cannot depend upon any MediaWiki
* code.
*/
class
ComposerVendorHtaccessCreator
{
/**
* Handle post-install-cmd and post-update-cmd hooks
*/
public
static
function
onEvent
()
{
$fname
=
dirname
(
dirname
(
__DIR__
)
)
.
"/vendor/.htaccess"
;
if
(
file_exists
(
$fname
)
)
{
// Already exists
return
;
}
file_put_contents
(
$fname
,
"Require all denied
\n
"
.
"Satisfy All
\n
"
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Oct 4 2026, 17:47 (8 w, 1 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
a5/56/f8bb89206b47ca6d7aa81a10b1bd
Default Alt Text
ComposerVendorHtaccessCreator.php (689 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment