Skip to content

Commit 61755e0

Browse files
committed
Fixes #965 - Ignore files that don't end in .php
This ignores any files in Migrations that do not end in .php. It causes problems when scripts, or data, or documentation is left in the Migrations directory, and the migration task assumes that they are PHP Classes and crashes. Signed-Off-By: Rob Thomas <[email protected]>
1 parent fb1b721 commit 61755e0

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

app/sprinkles/core/src/Database/Migrator/MigrationLocator.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ public function getMigrations()
5454

5555
$migrations = [];
5656
foreach ($migrationFiles as $migrationFile) {
57-
$migrations[] = $this->getMigrationDetails($migrationFile);
57+
// Note that PSR4 insists that all php files must end in PHP, so ignore all
58+
// files that don't end in PHP.
59+
if (preg_match('/php$/', $migrationFile)) {
60+
$migrations[] = $this->getMigrationDetails($migrationFile);
61+
}
5862
}
5963

6064
return $migrations;

0 commit comments

Comments
 (0)