Преглед на файлове

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 години
родител
ревизия
877f5f539b
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      lib/lib_install.php

+ 1 - 1
lib/lib_install.php

@@ -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;
 }