upgrade change

This commit is contained in:
Yuri Kuznetsov
2022-04-25 11:40:05 +03:00
parent 6347992b6e
commit 1905be823d
2 changed files with 6 additions and 18 deletions
@@ -32,16 +32,10 @@ class BeforeUpgrade
public function run(): void
{
if (php_sapi_name() === 'cli' && !in_array('-s', $_SERVER['argv'])) {
$contents = file_get_contents('application/Espo/Core/Console/Commands/Upgrade.php');
echo "\n\nPlease re-run upgrade command with -s parameter:\n";
echo " php command.php upgrade -s\n\n";
$needle = "\$this->runSteps(\$upgradeId, \$stepList);\r\n }";
if (strpos($contents, $needle) !== false) {
echo "\n\nPlease re-run upgrade command with -s parameter:\n";
echo " php command.php upgrade -s\n\n";
throw new \Espo\Core\Exceptions\Error("Need -s parameter.");
}
throw new \Espo\Core\Exceptions\Error("Need -s parameter.");
}
}
}
@@ -32,16 +32,10 @@ class BeforeUpgrade
public function run(): void
{
if (php_sapi_name() === 'cli' && !in_array('-s', $_SERVER['argv'])) {
$contents = file_get_contents('application/Espo/Core/Console/Commands/Upgrade.php');
echo "\n\nPlease re-run upgrade command with -s parameter:\n";
echo " php command.php upgrade -s\n\n";
$needle = "\$this->runSteps(\$upgradeId, \$stepList);\r\n }";
if (strpos($contents, $needle) !== false) {
echo "\n\nPlease re-run upgrade command with -s parameter:\n";
echo " php command.php upgrade -s\n\n";
throw new \Espo\Core\Exceptions\Error("Need -s parameter.");
}
throw new \Espo\Core\Exceptions\Error("Need -s parameter.");
}
}
}