|
|
@@ -2346,7 +2346,7 @@ function MakeCommand($command_id,$command,$installer_tmp,$installer_dir) {
|
|
|
return $ins_sh;
|
|
|
}
|
|
|
|
|
|
-function encodePhpFiles($installer_dir, $domains = "", $domainEncodePhpFiles = []) {
|
|
|
+function encodePhpFiles($installer_dir, $domains = "", $domainEncodePhpFiles = [], $noEncodePhpFiles = []) {
|
|
|
if (empty($installer_dir)) throw new Exception("Install path not found");
|
|
|
if ($domainEncodePhpFiles and (!$domains)) throw new Exception("Domains not definied");
|
|
|
|
|
|
@@ -2363,16 +2363,19 @@ 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, $domainEncodePhpFiles));
|
|
|
+ return (!in_array($phpFilePath, array_merge($domainEncodePhpFiles, $noEncodePhpFiles)));
|
|
|
});
|
|
|
DEBUG_S(-3,'freeEncodePhpFiles',$freeEncodePhpFiles,__FILE__,__FUNCTION__,__LINE__);
|
|
|
// if (empty($freeEncodePhpFiles)) throw new Exception("No php files to encode");
|
|
|
@@ -2595,7 +2598,10 @@ function MAKE_PKG_COMPONENT($h,$installer_dir_tar,$installer_url,$installer_tmp,
|
|
|
'wfs-qgis.php',
|
|
|
'wfs.php',
|
|
|
];
|
|
|
- if (!encodePhpFiles($installer_dir, $domains, $domainEncodePhpFiles)) {
|
|
|
+ $noEncodePhpFiles = [
|
|
|
+ '.config_base_structure.php',
|
|
|
+ ];
|
|
|
+ if (!encodePhpFiles($installer_dir, $domains, $domainEncodePhpFiles, $noEncodePhpFiles)) {
|
|
|
DEBUG_S(-3, "No php files found to encode", [], __FILE__,__FUNCTION__,__LINE__);
|
|
|
}
|
|
|
} catch (Exception $e) {
|