From b9ee50347c1ea5f9a94c9aae8afa613f97822172 Mon Sep 17 00:00:00 2001 From: Taras Machyshyn Date: Fri, 19 Jun 2026 16:49:33 +0300 Subject: [PATCH] Upgrade script: path exclusions for customization checks --- upgrades/10.0/scripts/BeforeUpgrade.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/upgrades/10.0/scripts/BeforeUpgrade.php b/upgrades/10.0/scripts/BeforeUpgrade.php index 37be09a4a2..4625fab059 100644 --- a/upgrades/10.0/scripts/BeforeUpgrade.php +++ b/upgrades/10.0/scripts/BeforeUpgrade.php @@ -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; + } }