Merged in bugfix/PMC-1213 (pull request #7079)
PMC-1213 Set missing values Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
namespace App\Console\Commands;
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
use Maveriks\WebApplication;
|
use Maveriks\WebApplication;
|
||||||
|
use ProcessMaker\Core\System;
|
||||||
|
|
||||||
trait AddParametersTrait
|
trait AddParametersTrait
|
||||||
{
|
{
|
||||||
@@ -33,6 +34,7 @@ trait AddParametersTrait
|
|||||||
{
|
{
|
||||||
$workspace = $this->option('workspace');
|
$workspace = $this->option('workspace');
|
||||||
if (!empty($workspace)) {
|
if (!empty($workspace)) {
|
||||||
|
System::readServerInfoFile($workspace);
|
||||||
$webApplication = new WebApplication();
|
$webApplication = new WebApplication();
|
||||||
$webApplication->setRootDir($this->option('processmakerPath'));
|
$webApplication->setRootDir($this->option('processmakerPath'));
|
||||||
$webApplication->loadEnvironment($workspace);
|
$webApplication->loadEnvironment($workspace);
|
||||||
|
|||||||
@@ -1001,16 +1001,16 @@ class System
|
|||||||
$arrayDataEmailServerConfig = array(
|
$arrayDataEmailServerConfig = array(
|
||||||
"MESS_ENGINE" => $arrayEmailServerDefault["MESS_ENGINE"],
|
"MESS_ENGINE" => $arrayEmailServerDefault["MESS_ENGINE"],
|
||||||
"MESS_SERVER" => $arrayEmailServerDefault["MESS_SERVER"],
|
"MESS_SERVER" => $arrayEmailServerDefault["MESS_SERVER"],
|
||||||
"MESS_PORT" => (int)($arrayEmailServerDefault["MESS_PORT"]),
|
"MESS_PORT" => (int) ($arrayEmailServerDefault["MESS_PORT"]),
|
||||||
"MESS_RAUTH" => (int)($arrayEmailServerDefault["MESS_RAUTH"]),
|
"MESS_RAUTH" => (int) ($arrayEmailServerDefault["MESS_RAUTH"]),
|
||||||
"MESS_ACCOUNT" => $arrayEmailServerDefault["MESS_ACCOUNT"],
|
"MESS_ACCOUNT" => $arrayEmailServerDefault["MESS_ACCOUNT"],
|
||||||
"MESS_PASSWORD" => $arrayEmailServerDefault["MESS_PASSWORD"],
|
"MESS_PASSWORD" => $arrayEmailServerDefault["MESS_PASSWORD"],
|
||||||
"MESS_FROM_MAIL" => $arrayEmailServerDefault["MESS_FROM_MAIL"],
|
"MESS_FROM_MAIL" => $arrayEmailServerDefault["MESS_FROM_MAIL"],
|
||||||
"MESS_FROM_NAME" => $arrayEmailServerDefault["MESS_FROM_NAME"],
|
"MESS_FROM_NAME" => $arrayEmailServerDefault["MESS_FROM_NAME"],
|
||||||
"SMTPSecure" => $arrayEmailServerDefault["SMTPSECURE"],
|
"SMTPSecure" => $arrayEmailServerDefault["SMTPSECURE"],
|
||||||
"MESS_TRY_SEND_INMEDIATLY" => (int)($arrayEmailServerDefault["MESS_TRY_SEND_INMEDIATLY"]),
|
"MESS_TRY_SEND_INMEDIATLY" => (int) ($arrayEmailServerDefault["MESS_TRY_SEND_INMEDIATLY"]),
|
||||||
"MAIL_TO" => $arrayEmailServerDefault["MAIL_TO"],
|
"MAIL_TO" => $arrayEmailServerDefault["MAIL_TO"],
|
||||||
"MESS_DEFAULT" => (int)($arrayEmailServerDefault["MESS_DEFAULT"]),
|
"MESS_DEFAULT" => (int) ($arrayEmailServerDefault["MESS_DEFAULT"]),
|
||||||
"MESS_ENABLED" => 1,
|
"MESS_ENABLED" => 1,
|
||||||
"MESS_BACKGROUND" => "",
|
"MESS_BACKGROUND" => "",
|
||||||
"MESS_PASSWORD_HIDDEN" => "",
|
"MESS_PASSWORD_HIDDEN" => "",
|
||||||
@@ -1682,4 +1682,21 @@ class System
|
|||||||
}
|
}
|
||||||
return (object) $result;
|
return (object) $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This read the server information file and set the missing values to $_SERVER.
|
||||||
|
* @param string $workspace
|
||||||
|
*/
|
||||||
|
public static function readServerInfoFile(string $workspace)
|
||||||
|
{
|
||||||
|
$path = PATH_DATA . "sites" . DIRECTORY_SEPARATOR . $workspace . DIRECTORY_SEPARATOR;
|
||||||
|
if (is_file($path . '.server_info')) {
|
||||||
|
$string = file_get_contents($path . '.server_info');
|
||||||
|
$result = unserialize($string);
|
||||||
|
$_SERVER['SERVER_NAME'] = $result['SERVER_NAME'];
|
||||||
|
$_SERVER['SERVER_PORT'] = $result['SERVER_PORT'];
|
||||||
|
} else {
|
||||||
|
eprintln('WARNING! No server info found!', 'red');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user