|
|
@@ -2363,13 +2363,16 @@ function encodePhpFiles($installer_dir, $domains = "", $domainEncodePhpFiles = [
|
|
|
}, $out);
|
|
|
|
|
|
$domainEncodePhpFiles = array_filter($allPhpFiles, function ($phpFilePath) use ($domainEncodePhpFiles) {
|
|
|
- foreach ($domainEncodePhpFiles as $file) {
|
|
|
- if (preg_match("|^[[:digit:]]+/" . str_replace('.', '\.', $file) . "$|", $phpFilePath)) return true;
|
|
|
- }
|
|
|
- return false;
|
|
|
+ preg_match('/^[[:digit:]]+\/(.*)$/', $phpFilePath, $matches);
|
|
|
+ if (!$matches || empty($matches[1])) throw new Exception("Błąd ścieżki pliku {$phpFilePath}");
|
|
|
+ $phpFilePath = $matches[1];
|
|
|
+ return (in_array($phpFilePath, $domainEncodePhpFiles));
|
|
|
});
|
|
|
|
|
|
$freeEncodePhpFiles = array_filter($allPhpFiles, function ($phpFilePath) use ($domainEncodePhpFiles) {
|
|
|
+ preg_match('/^[[:digit:]]+\/(.*)$/', $phpFilePath, $matches);
|
|
|
+ if (!$matches || empty($matches[1])) throw new Exception("Błąd ścieżki pliku {$phpFilePath}");
|
|
|
+ $phpFilePath = $matches[1];
|
|
|
if ('se-lib/Vendor/' === substr($phpFilePath, 0, strlen('se-lib/Vendor/'))) return false; // SKIP se-lib/Vendor/*
|
|
|
if ('.ini.php' === substr($phpFilePath, -1 * strlen('.ini.php'))) return false; // SKIP *.ini.php
|
|
|
return (!in_array($phpFilePath, array_merge($domainEncodePhpFiles, $noEncodePhpFiles)));
|