PMC-1213 Set missing values, previous changes are reverted.
This commit is contained in:
@@ -3,7 +3,6 @@
|
|||||||
namespace App\Console\Commands;
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
use Maveriks\WebApplication;
|
use Maveriks\WebApplication;
|
||||||
use ProcessMaker\Core\System;
|
|
||||||
|
|
||||||
trait AddParametersTrait
|
trait AddParametersTrait
|
||||||
{
|
{
|
||||||
@@ -34,10 +33,9 @@ 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, false);
|
||||||
}
|
}
|
||||||
parent::handle();
|
parent::handle();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1682,21 +1682,4 @@ 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