fix: glob not work with phar
This commit is contained in:
@@ -5,6 +5,8 @@ namespace Openguru\OpenCartFramework\Migrations;
|
|||||||
use Exception;
|
use Exception;
|
||||||
use Openguru\OpenCartFramework\Logger\LoggerInterface;
|
use Openguru\OpenCartFramework\Logger\LoggerInterface;
|
||||||
use Openguru\OpenCartFramework\QueryBuilder\Connections\ConnectionInterface;
|
use Openguru\OpenCartFramework\QueryBuilder\Connections\ConnectionInterface;
|
||||||
|
use RecursiveDirectoryIterator;
|
||||||
|
use RecursiveIteratorIterator;
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
|
|
||||||
class MigratorService
|
class MigratorService
|
||||||
@@ -68,8 +70,12 @@ SQL;
|
|||||||
private function findMigrationsToApply(array $applied): array
|
private function findMigrationsToApply(array $applied): array
|
||||||
{
|
{
|
||||||
$migrations = [];
|
$migrations = [];
|
||||||
foreach (glob($this->migrationsPath . '/*.php') as $file) {
|
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->migrationsPath));
|
||||||
$migrations[] = basename($file);
|
|
||||||
|
foreach ($iterator as $file) {
|
||||||
|
if ($file->isFile() && $file->getExtension() === 'php') {
|
||||||
|
$migrations[] = $file->getFilename();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return array_diff($migrations, $applied);
|
return array_diff($migrations, $applied);
|
||||||
|
|||||||
Reference in New Issue
Block a user