mirror of
https://github.com/friendica/friendica
synced 2025-04-26 15:10:11 +00:00
Adjust update parameters:
-f|--force Force the update command (Even if the database structure matches) -o|--override Override running or stalling updates
This commit is contained in:
parent
7ce549c294
commit
aae58815a8
8 changed files with 26 additions and 26 deletions
|
@ -48,18 +48,19 @@ class Update
|
|||
* Automatic database updates
|
||||
*
|
||||
* @param string $basePath The base path of this application
|
||||
* @param bool $force Force the Update-Check even if the lock is set
|
||||
* @param bool $force Force the Update-Check even if the database version doesn't match
|
||||
* @param bool $override Overrides any running/stuck updates
|
||||
* @param bool $verbose Run the Update-Check verbose
|
||||
* @param bool $sendMail Sends a Mail to the administrator in case of success/failure
|
||||
*
|
||||
* @return string Empty string if the update is successful, error messages otherwise
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function run($basePath, $force = false, $verbose = false, $sendMail = true)
|
||||
public static function run($basePath, $force = false, $override = false, $verbose = false, $sendMail = true)
|
||||
{
|
||||
// In force mode, we release the dbupdate lock first
|
||||
// Necessary in case of an stuck update
|
||||
if ($force) {
|
||||
if ($override) {
|
||||
Lock::release('dbupdate', true);
|
||||
}
|
||||
|
||||
|
@ -70,12 +71,12 @@ class Update
|
|||
Config::set('system', 'build', $build);
|
||||
}
|
||||
|
||||
if ($build != DB_UPDATE_VERSION) {
|
||||
if ($build != DB_UPDATE_VERSION || $force) {
|
||||
require_once 'update.php';
|
||||
|
||||
$stored = intval($build);
|
||||
$current = intval(DB_UPDATE_VERSION);
|
||||
if ($stored < $current) {
|
||||
if ($stored < $current || $force) {
|
||||
Config::load('database');
|
||||
|
||||
Logger::log('Update from \'' . $stored . '\' to \'' . $current . '\' - starting', Logger::DEBUG);
|
||||
|
@ -126,8 +127,6 @@ class Update
|
|||
Lock::release('dbupdate');
|
||||
}
|
||||
}
|
||||
} elseif ($force) {
|
||||
DBStructure::update($basePath, $verbose, true);
|
||||
}
|
||||
|
||||
return '';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue