aboutsummaryrefslogtreecommitdiff
path: root/lib/lib_install.php
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2020-07-14 10:25:48 +0200
committerGravatar GitHub <noreply@github.com> 2020-07-14 10:25:48 +0200
commit877f5f539b82db2e59ecf7257fce18dc9245f310 (patch)
tree7c11e2a65f0b2e626b2bd0b282eb3585530a788d /lib/lib_install.php
parentcada19eb876a3537bb5694c24be2ec159ae6816a (diff)
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.
Diffstat (limited to 'lib/lib_install.php')
-rw-r--r--lib/lib_install.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/lib_install.php b/lib/lib_install.php
index e650a20b3..f171deb4a 100644
--- a/lib/lib_install.php
+++ b/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;
}