Update version table (require to handle migrations via CLI)

ofaj
jmontoyaa 9 years ago
parent 7619f8c75f
commit f70337a3fc
  1. 14
      main/install/install.lib.php

@ -415,7 +415,7 @@ function & get_language_folder_list()
closedir($handle);
asort($result);
}
return $result;
}
@ -2178,6 +2178,18 @@ function finishInstallation(
lockSettings();
updateDirAndFilesPermissions();
// Set the latest version
$path = api_get_path(SYS_PATH).'app/Migrations/Schema/V111/';
$finder = new \Symfony\Component\Finder\Finder();
$files = $finder->files()->in($path);
$list = array_reverse((array)$files->files()->sortByName()->getIterator());
/** @var SplFileInfo $lastVersion */
$lastVersion = current($list);
$version = str_replace(['Version', '.php' ], '', $lastVersion->getFilename());
$sql = "INSERT INTO version VALUES ('$version')";
Database::query($sql);
}
/**

Loading…
Cancel
Save