Merged in release/3.4.0 (pull request #7083)

Release/3.4.0

Approved-by: Paula Quispe <paula.quispe@processmaker.com>
Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
Paula Quispe
2019-09-25 14:12:20 +00:00
committed by Julio Cesar Laura Avendaño
4 changed files with 36 additions and 30 deletions

View File

@@ -35,7 +35,7 @@ trait AddParametersTrait
if (!empty($workspace)) { if (!empty($workspace)) {
$webApplication = new WebApplication(); $webApplication = new WebApplication();
$webApplication->setRootDir($this->option('processmakerPath')); $webApplication->setRootDir($this->option('processmakerPath'));
$webApplication->loadEnvironment($workspace); $webApplication->loadEnvironment($workspace, false);
} }
parent::handle(); parent::handle();
} }

View File

@@ -429,16 +429,19 @@ class WebApplication
} }
/** /**
* Define constants, setup configuration and initialize Laravel * Define constants, setup configuration and initialize Laravel.
* The value of $executeSetupPlugin must always be true for a web environment.
* *
* @param string $workspace * @param string $workspace
* @param boolean $executeSetupPlugin
* @return bool * @return bool
* @throws Exception * @throws Exception
* *
* @see run() * @see run()
* @see workflow/engine/bin/cli.php * @see workflow/engine/bin/cli.php
* @see \App\Console\Commands\AddParametersTrait
*/ */
public function loadEnvironment($workspace = "") public function loadEnvironment($workspace = "", $executeSetupPlugin = true)
{ {
define("PATH_SEP", DIRECTORY_SEPARATOR); define("PATH_SEP", DIRECTORY_SEPARATOR);
@@ -624,7 +627,9 @@ class WebApplication
// Initialization functions plugins // Initialization functions plugins
$oPluginRegistry->init(); $oPluginRegistry->init();
//get and setup enabled plugins //get and setup enabled plugins
$oPluginRegistry->setupPlugins(); if ($executeSetupPlugin === true) {
$oPluginRegistry->setupPlugins();
}
return true; return true;
} }

View File

@@ -118,7 +118,8 @@ trait SuggestTrait
} }
} }
if ($optionsLimit >= 0) { // Define if we need to add a limit in the query
if ($optionsLimit > 0) {
$this->addSuggestLimit($json, $select, $limit, $where); $this->addSuggestLimit($json, $select, $limit, $where);
} else { } else {
$this->addSuggestWhere($json, $parsed, $select, $where, $having); $this->addSuggestWhere($json, $parsed, $select, $where, $having);

View File

@@ -180,17 +180,17 @@ class System
} }
/* For distros with the lsb_release, this returns a one-line description of /* For distros with the lsb_release, this returns a one-line description of
* the distro name, such as "CentOS release 5.3 (Final)" or "Ubuntu 10.10" * the distro name, such as "CentOS release 5.3 (Final)" or "Ubuntu 10.10"
*/ */
$distro = ''; $distro = '';
if (file_exists("/dev/")) { //Windows does not have this folder if (file_exists("/dev/")) { //Windows does not have this folder
$distro = exec("lsb_release -d -s 2> /dev/null"); $distro = exec("lsb_release -d -s 2> /dev/null");
} }
/* For distros without lsb_release, we look for *release (such as /* For distros without lsb_release, we look for *release (such as
* redhat-release, gentoo-release, SuSE-release, etc) or *version (such as * redhat-release, gentoo-release, SuSE-release, etc) or *version (such as
* debian_version, slackware-version, etc) * debian_version, slackware-version, etc)
*/ */
if (empty($distro)) { if (empty($distro)) {
foreach (glob("/etc/*release") as $filename) { foreach (glob("/etc/*release") as $filename) {
$distro = trim(file_get_contents($filename)); $distro = trim(file_get_contents($filename));
@@ -209,8 +209,8 @@ class System
} }
/* CentOS returns a string with quotes, remove them and append /* CentOS returns a string with quotes, remove them and append
* the OS name (such as LINUX, WINNT, DARWIN, etc) * the OS name (such as LINUX, WINNT, DARWIN, etc)
*/ */
$distro = trim($distro, "\"") . " (" . PHP_OS . ")"; $distro = trim($distro, "\"") . " (" . PHP_OS . ")";
$Fields = []; $Fields = [];
@@ -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" => "",
@@ -1088,7 +1088,7 @@ class System
} }
$res['SKIN_CREATEDATE'] = (isset($res['SKIN_CREATEDATE'])) ? $res['SKIN_CREATEDATE'] : ''; $res['SKIN_CREATEDATE'] = (isset($res['SKIN_CREATEDATE'])) ? $res['SKIN_CREATEDATE'] : '';
$res['SKIN_MODIFIEDDATE'] = (isset($res['SKIN_MODIFIEDDATE'])) ? $res['SKIN_MODIFIEDDATE'] : ''; $res['SKIN_MODIFIEDDATE'] = (isset($res['SKIN_MODIFIEDDATE'])) ? $res['SKIN_MODIFIEDDATE'] : '';
$res['SKIN_TYPE_GLOBAL'] = false; $res['SKIN_TYPE_GLOBAL'] = false;
if (isset($res['SKIN_WORKSPACE'])) { if (isset($res['SKIN_WORKSPACE'])) {
if ($res['SKIN_WORKSPACE'] === '') { if ($res['SKIN_WORKSPACE'] === '') {
@@ -1503,24 +1503,24 @@ class System
$content = "<?php \n" . $content . "\n" . $insertStatements . "\n"; $content = "<?php \n" . $content . "\n" . $insertStatements . "\n";
return file_put_contents($filename, $content) !== false; return file_put_contents($filename, $content) !== false;
} }
/** /**
* Set Connection Configuration using "config" helper from "Laravel" with * Set Connection Configuration using "config" helper from "Laravel" with
* the constants defined in file "db.php" * the constants defined in file "db.php"
*/ */
public static function setConnectionConfig( public static function setConnectionConfig(
$dbAdapter, $dbAdapter,
$dbHost, $dbHost,
$dbName, $dbName,
$dbUser, $dbUser,
$dbPass, $dbPass,
$dbRbacHost, $dbRbacHost,
$dbRbacName, $dbRbacName,
$dbRbacUser, $dbRbacUser,
$dbRbacPass, $dbRbacPass,
$dbReportHost, $dbReportHost,
$dbReportName, $dbReportName,
$dbReportUser, $dbReportUser,
$dbReportPass) $dbReportPass)
{ {
config(['connections.driver' => $dbAdapter]); config(['connections.driver' => $dbAdapter]);