From 52322493dff2c7d3939d23eda30a973acc5fab6c Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Fri, 25 Aug 2017 10:57:20 -0400 Subject: [PATCH] HOR-3769 Fix Net class and error reporting level. --- framework/src/Maveriks/WebApplication.php | 1 + processmaker | 1 - workflow/engine/classes/Net.php | 38 ++++++++++++++++++++++- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/framework/src/Maveriks/WebApplication.php b/framework/src/Maveriks/WebApplication.php index 56caa5907..12a680e00 100644 --- a/framework/src/Maveriks/WebApplication.php +++ b/framework/src/Maveriks/WebApplication.php @@ -485,6 +485,7 @@ class WebApplication // Change storage path app()->useStoragePath(realpath(PATH_DATA)); app()->make(Kernel::class)->bootstrap(); + error_reporting(error_reporting() & ~E_STRICT & ~E_DEPRECATED); \Bootstrap::setLanguage(); diff --git a/processmaker b/processmaker index 947685aa0..8d5144b45 100755 --- a/processmaker +++ b/processmaker @@ -6,7 +6,6 @@ use Illuminate\Foundation\Console\Kernel; require_once __DIR__ . '/gulliver/system/class.g.php'; require_once __DIR__ . '/bootstrap/autoload.php'; require_once __DIR__ . '/bootstrap/app.php'; -$app->make(Kernel::class)->bootstrap(); $scriptDir = dirname(__FILE__).'/'; diff --git a/workflow/engine/classes/Net.php b/workflow/engine/classes/Net.php index 69bbef50a..8aac86469 100644 --- a/workflow/engine/classes/Net.php +++ b/workflow/engine/classes/Net.php @@ -19,13 +19,49 @@ class Net public function __construct() { $a = func_get_args(); - $f = "__construct" . func_num_args(); + $f = "init" . func_num_args(); if (method_exists($this, $f)) { call_user_func_array(array($this, $f), $a); } } + /** + * This function is the constructor of the class net + * + * return void + */ + protected function init0() + { + $this->errno = 0; + $this->error = ""; + } + + /** + * This function is the constructor of the class net + * + * @param string $pHost + * @return void + */ + protected function init1($pHost) + { + $this->errno = 0; + $this->errstr = ""; + $this->db_instance = ""; + + unset($this->db_user); + unset($this->db_passwd); + unset($this->db_sourcename); + + #verifing valid param + if ($pHost == "") { + $this->errno = 1000; + $this->errstr = "NET::You must specify a host"; + //$this->showMsg(); + } + $this->resolv($pHost); + } + /** * This function puts a host *