Upgrade script: path exclusions for customization checks

This commit is contained in:
Taras Machyshyn
2026-06-19 16:49:33 +03:00
parent 875516f005
commit b9ee50347c

View File

@@ -203,6 +203,10 @@ class BeforeUpgrade
continue;
}
if (self::toIgnoreFile($file)) {
continue;
}
if ($file->getExtension() !== 'php') {
continue;
}
@@ -262,4 +266,20 @@ class BeforeUpgrade
return $classes;
}
private static function toIgnoreFile(string $file): bool
{
$ignorePathRegexList = [
'^custom\/Espo\/Modules\/[^\/]+\/vendor',
'^custom\/Espo\/Custom\/vendor',
];
foreach ($ignorePathRegexList as $pattern) {
if (preg_match('/' . $pattern . '/', $file)) {
return true;
}
}
return false;
}
}