1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
|
From: William Desportes <williamdes@wdes.fr>
Date: Sun, 15 Dec 2024 23:37:51 +0100
Subject: Disable all the file generation or deletion in ServerFilesGenerator
and CheckDirectDependencyUse command
Origin: vendor
Forwarded: not-needed
---
plugins/Installation/ServerFilesGenerator.php | 12 ++++++++++++
plugins/TestRunner/Commands/CheckDirectDependencyUse.php | 5 +++++
2 files changed, 17 insertions(+)
diff --git a/plugins/Installation/ServerFilesGenerator.php b/plugins/Installation/ServerFilesGenerator.php
index 8889cd0..f127989 100644
--- a/plugins/Installation/ServerFilesGenerator.php
+++ b/plugins/Installation/ServerFilesGenerator.php
@@ -17,6 +17,8 @@ class ServerFilesGenerator
{
public static function createFilesForSecurity()
{
+ return;
+
self::createHtAccessFiles();
self::createWebConfigFiles();
self::createWebRootFiles();
@@ -28,6 +30,8 @@ class ServerFilesGenerator
*/
public static function createHtAccessFiles()
{
+ return;
+
$denyAll = self::getDenyAllHtaccessContent();
$allow = self::getAllowHtaccessContent();
@@ -111,6 +115,8 @@ Header set Cache-Control \"Cache-Control: private, no-cache, no-store\"
*/
protected static function createHtAccess($path, $overwrite, $content)
{
+ return;
+
$file = $path . '/.htaccess';
$content = "# This file is auto generated by Matomo, do not edit directly\n# Please report any issue or improvement directly to the Matomo team.\n\n" . $content;
@@ -212,6 +218,8 @@ Header set Cache-Control \"Cache-Control: private, no-cache, no-store\"
public static function deleteWebConfigFiles()
{
+ return;
+
$path = PIWIK_INCLUDE_PATH;
@unlink($path . '/web.config');
@unlink($path . '/libs/web.config');
@@ -230,6 +238,8 @@ Header set Cache-Control \"Cache-Control: private, no-cache, no-store\"
*/
public static function createWebRootFiles()
{
+ return;
+
$filesToCreate = array(
'/robots.txt',
'/favicon.ico',
@@ -326,6 +336,8 @@ HTACCESS_ALLOW;
*/
public static function deleteHtAccessFiles()
{
+ return;
+
$files = Filesystem::globr(PIWIK_INCLUDE_PATH, ".htaccess");
// only delete files that match the list of directories we create htaccess files in
diff --git a/plugins/TestRunner/Commands/CheckDirectDependencyUse.php b/plugins/TestRunner/Commands/CheckDirectDependencyUse.php
index 00582cd..f81aa86 100644
--- a/plugins/TestRunner/Commands/CheckDirectDependencyUse.php
+++ b/plugins/TestRunner/Commands/CheckDirectDependencyUse.php
@@ -21,6 +21,11 @@ class CheckDirectDependencyUse extends ConsoleCommand
protected function doExecute(): int
{
+ $output = $this->getOutput();
+ $output->writeln("<error>Unavailable on Debian systems, the dependencies are installed by packages.</error>");
+
+ return self::FAILURE;
+
[$psr4NamespacePrefixes, $psr0Prefixes] = $this->getCoreDependencyNamespacePrefixes();
$input = $this->getInput();
|