PMC-1213 Set missing values, previous changes are reverted.
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Maveriks\WebApplication;
|
||||
use ProcessMaker\Core\System;
|
||||
|
||||
trait AddParametersTrait
|
||||
{
|
||||
@@ -34,10 +33,9 @@ trait AddParametersTrait
|
||||
{
|
||||
$workspace = $this->option('workspace');
|
||||
if (!empty($workspace)) {
|
||||
System::readServerInfoFile($workspace);
|
||||
$webApplication = new WebApplication();
|
||||
$webApplication->setRootDir($this->option('processmakerPath'));
|
||||
$webApplication->loadEnvironment($workspace);
|
||||
$webApplication->loadEnvironment($workspace, false);
|
||||
}
|
||||
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 boolean $executeSetupPlugin
|
||||
* @return bool
|
||||
* @throws Exception
|
||||
*
|
||||
* @see run()
|
||||
* @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);
|
||||
|
||||
@@ -624,7 +627,9 @@ class WebApplication
|
||||
// Initialization functions plugins
|
||||
$oPluginRegistry->init();
|
||||
//get and setup enabled plugins
|
||||
if ($executeSetupPlugin === true) {
|
||||
$oPluginRegistry->setupPlugins();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1682,21 +1682,4 @@ class System
|
||||
}
|
||||
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