4
0
Эх сурвалжийг харах

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.
Marien Fressinaud 5 жил өмнө
parent
commit
877f5f539b

+ 1 - 1
lib/lib_install.php

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