diff --git a/module/oc_telegram_shop/upload/oc_telegram_shop/framework/Migrations/MigratorService.php b/module/oc_telegram_shop/upload/oc_telegram_shop/framework/Migrations/MigratorService.php index 505fa10..3783500 100644 --- a/module/oc_telegram_shop/upload/oc_telegram_shop/framework/Migrations/MigratorService.php +++ b/module/oc_telegram_shop/upload/oc_telegram_shop/framework/Migrations/MigratorService.php @@ -5,6 +5,8 @@ namespace Openguru\OpenCartFramework\Migrations; use Exception; use Openguru\OpenCartFramework\Logger\LoggerInterface; use Openguru\OpenCartFramework\QueryBuilder\Connections\ConnectionInterface; +use RecursiveDirectoryIterator; +use RecursiveIteratorIterator; use RuntimeException; class MigratorService @@ -68,8 +70,12 @@ SQL; private function findMigrationsToApply(array $applied): array { $migrations = []; - foreach (glob($this->migrationsPath . '/*.php') as $file) { - $migrations[] = basename($file); + $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->migrationsPath)); + + foreach ($iterator as $file) { + if ($file->isFile() && $file->getExtension() === 'php') { + $migrations[] = $file->getFilename(); + } } return array_diff($migrations, $applied);