From 08636b550f0f23e9be3736894906ef108fa3fb13 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Tue, 15 Sep 2020 11:25:49 +0300 Subject: [PATCH] upgrade cli check --- upgrades/6.0/scripts/BeforeUpgrade.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/upgrades/6.0/scripts/BeforeUpgrade.php b/upgrades/6.0/scripts/BeforeUpgrade.php index 711c5ddd5e..a78796b666 100644 --- a/upgrades/6.0/scripts/BeforeUpgrade.php +++ b/upgrades/6.0/scripts/BeforeUpgrade.php @@ -35,11 +35,22 @@ class BeforeUpgrade { $this->container = $container; + $this->processCheckCLI(); + $this->processMyIsamCheck(); $this->processNextNumberAlterTable(); } + protected function processCheckCLI() + { + $isCli = (substr(php_sapi_name(), 0, 3) == 'cli') ? true : false; + + if (!$isCli) { + throw new Error("This upgrade can be run only from CLI."); + } + } + protected function processMyIsamCheck() { $myisamTableList = $this->getMyIsamTableList();