From a8acafdb6971ddf8c630addfbeb64b0d60794da5 Mon Sep 17 00:00:00 2001 From: yuri Date: Fri, 22 Feb 2019 12:41:20 +0200 Subject: [PATCH] update and extension message changes --- extension.php | 12 ++++-------- upgrade.php | 14 +++++--------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/extension.php b/extension.php index e729b96931..f31de4e5bf 100644 --- a/extension.php +++ b/extension.php @@ -27,18 +27,14 @@ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ -$sapiName = php_sapi_name(); - -if (substr($sapiName, 0, 3) != 'cli') { - die("Extension installer script can be run only via CLI.\n"); -} +if (substr(php_sapi_name(), 0, 3) != 'cli') exit; include "bootstrap.php"; $arg = isset($_SERVER['argv'][1]) ? trim($_SERVER['argv'][1]) : ''; if (empty($arg)) { - die("Specify extension package file.\n"); + die("Extension package file is not specified.\n"); } if (!file_exists($arg)) { @@ -60,7 +56,7 @@ $app->getContainer()->setUser($user); $upgradeManager = new \Espo\Core\ExtensionManager($app->getContainer()); -echo "Start install process...\n"; +echo "Starting installation process...\n"; try { $fileData = file_get_contents($arg); @@ -77,4 +73,4 @@ try { $app->runRebuild(); } catch (\Exception $e) {} -echo "Installation is complete.\n"; +echo "Extension installation is complete.\n"; diff --git a/upgrade.php b/upgrade.php index 6aa8341af0..90bb72e045 100644 --- a/upgrade.php +++ b/upgrade.php @@ -27,11 +27,7 @@ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ -$sapiName = php_sapi_name(); - -if (substr($sapiName, 0, 3) != 'cli') { - die("Upgrade script can be run only via CLI.\n"); -} +if (substr(php_sapi_name(), 0, 3) != 'cli') exit; include "bootstrap.php"; @@ -43,7 +39,7 @@ if ($arg == 'version' || $arg == '-v') { } if (empty($arg)) { - die("Specify an upgrade package file.\n"); + die("Upgrade package file is not specified.\n"); } if (!file_exists($arg)) { @@ -66,14 +62,14 @@ $app->getContainer()->setUser($user); $upgradeManager = new \Espo\Core\UpgradeManager($app->getContainer()); echo "Current version is " . $config->get('version') . "\n"; -echo "Start upgrade process...\n"; +echo "Starting upgrade process...\n"; try { $fileData = file_get_contents($arg); $fileData = 'data:application/zip;base64,' . base64_encode($fileData); $upgradeId = $upgradeManager->upload($fileData); - $upgradeManager->install(array('id' => $upgradeId)); + $upgradeManager->install(['id' => $upgradeId]); } catch (\Exception $e) { die("Error: " . $e->getMessage() . "\n"); } @@ -83,4 +79,4 @@ try { $app->runRebuild(); } catch (\Exception $e) {} -echo "Upgrade is complete. New version is " . $config->get('version') . ". \n"; +echo "Upgrade is complete. Current version is " . $config->get('version') . ". \n";