浏览代码

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