Merge pull request #4367 from mlq/fix/migration-ksort

Call ksort correctly for migration files
This commit is contained in:
David Bomba 2020-11-27 06:56:02 +11:00 committed by GitHub
commit c1ec590782
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -252,9 +252,11 @@ class StepsController extends BaseController
$file = storage_path("migrations/{$fileName}.zip"); $file = storage_path("migrations/{$fileName}.zip");
ksort($localMigrationData);
$zip = new \ZipArchive(); $zip = new \ZipArchive();
$zip->open($file, \ZipArchive::CREATE | \ZipArchive::OVERWRITE); $zip->open($file, \ZipArchive::CREATE | \ZipArchive::OVERWRITE);
$zip->addFromString('migration.json', json_encode(ksort($localMigrationData), JSON_PRETTY_PRINT)); $zip->addFromString('migration.json', json_encode($localMigrationData, JSON_PRETTY_PRINT));
$zip->close(); $zip->close();
$localMigrationData['file'] = $file; $localMigrationData['file'] = $file;