fix: Test setupMigrations doesn't return false (#3113)

`file_put_contents` can return 0 if there’s nothing to write in the
`applied_migrations.txt` file, which is equivalent to `false`. Since
there are no migrations yet, this is what happens. Because this value
(i.e. `0`) is tested next in the `app/install.php` file, the install
script was failing.
This commit is contained in:
Marien Fressinaud
2020-07-14 10:25:48 +02:00
committed by GitHub
parent cada19eb87
commit 877f5f539b

View File

@@ -127,5 +127,5 @@ function setupMigrations() {
$migrator = new Minz_Migrator($migrations_path);
$versions = implode("\n", $migrator->versions());
return @file_put_contents($migrations_version_path, $versions);
return @file_put_contents($migrations_version_path, $versions) !== false;
}