fix: glob not work with phar
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user