update and extension message changes
This commit is contained in:
+4
-8
@@ -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";
|
||||
|
||||
+5
-9
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user