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; + } }