From 058077b0751aee1a0824959793a9e82d2b81526f Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Thu, 1 Feb 2024 15:37:53 +0000 Subject: [PATCH] Add flag for debug mode --- src/Request/Config/KernelConfigClass.php | 9 ++++++++- src/Request/ProcessRequestImpl/Process/ProcessManagerClass.php | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Request/Config/KernelConfigClass.php b/src/Request/Config/KernelConfigClass.php index f5aced3..fb7450f 100644 --- a/src/Request/Config/KernelConfigClass.php +++ b/src/Request/Config/KernelConfigClass.php @@ -29,6 +29,8 @@ class KernelConfigClass private static $nbMaxProcessByUser = 10; private static $nbMaxProcessGlobal = 100; + private static $isDebugMode = FALSE; + private static $userHost = ""; private static $userName = ""; @@ -50,6 +52,11 @@ class KernelConfigClass ); + public static function isDebugMode() + { + return self::$isDebugMode; + } + public static function setUserHost($userHost) { self::$userHost = $userHost; @@ -167,7 +174,7 @@ class KernelConfigClass "DDPATH" => KERNEL_CONFIG_DIR, "MY_GXX_HOME" => GCC_BASE_DIR, "PATH" => self::getKernelBinPath().":".COTS_BASE_DIR."/bin:".GCC_BASE_DIR."/bin:".getenv("PATH"), - "LD_LIBRARY_PATH" => COTS_BASE_DIR."/lib:".GCC_BASE_DIR."/lib64:".GCC_BASE_DIR."/lib:".getenv("LD_LIBRARY_PATH"), + "LD_LIBRARY_PATH" => COTS_BASE_DIR."/lib:".COTS_BASE_DIR."/lib64:".GCC_BASE_DIR."/lib64:".GCC_BASE_DIR."/lib:".getenv("LD_LIBRARY_PATH"), ); } diff --git a/src/Request/ProcessRequestImpl/Process/ProcessManagerClass.php b/src/Request/ProcessRequestImpl/Process/ProcessManagerClass.php index 413c8de..e5da5ff 100644 --- a/src/Request/ProcessRequestImpl/Process/ProcessManagerClass.php +++ b/src/Request/ProcessRequestImpl/Process/ProcessManagerClass.php @@ -350,7 +350,7 @@ class ProcessManagerClass if (!isset($process)) return array('success' => false, 'message' => 'Error to retrieve process info'); - $process->delete($process->getExitCode() != 0); + $process->delete(($process->getExitCode() != 0) || KernelConfigClass::isDebugMode()); $dom->documentElement->removeChild($processNode); -- libgit2 0.21.2