upgrade fix

This commit is contained in:
Yuri Kuznetsov
2020-09-23 10:17:07 +03:00
parent 86a85ba177
commit 9cfab5a7ea
@@ -140,8 +140,7 @@ class Upgrade extends Base
fwrite(\STDOUT, "\n");
$app = new \Espo\Core\Application();
$currentVerison = $app->getContainer()->get('config')->get('version');
$currentVerison = $this->getCurrentVersion();
fwrite(\STDOUT, "Upgrade is complete. Current version is {$currentVerison}.\n");
@@ -211,8 +210,7 @@ class Upgrade extends Base
return;
}
$app = new \Espo\Core\Application();
$currentVerison = $app->getContainer()->get('config')->get('version');
$currentVerison = $this->getCurrentVersion();
fwrite(\STDOUT, "Upgrade is complete. Current version is {$currentVerison}.\n");
@@ -406,4 +404,15 @@ class Upgrade extends Base
return true;
}
protected function getCurrentVersion()
{
$configData = include "data/config.php";
if (!$configData) {
return null;
}
return $configData['version'] ?? null;
}
}