From 66dabfa974356865a71704badfcac0970431c017 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janis=20Daniel=20Da=CC=88hne?= <janis.daehne2@student.uni-halle.de> Date: Sat, 23 Feb 2019 15:30:07 +0100 Subject: [PATCH] - allow both \r\n and \n to separate environment vars --- bootstrap.php | 2 +- readme.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bootstrap.php b/bootstrap.php index dc03cf6..0b12d7f 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -73,7 +73,7 @@ $config['environmentVars'] = $row['environmentVars']; //parse environmentVars if (isset($config['environmentVars'])) { - $keyValuePairs = explode("\r\n", $config['environmentVars']); + $keyValuePairs = preg_split("/\r\n|\n/", $config['environmentVars']); $config['environmentVarsParsed'] = $keyValuePairs; } else { $config['environmentVarsParsed'] = NULL; diff --git a/readme.md b/readme.md index 48699b0..78ce575 100644 --- a/readme.md +++ b/readme.md @@ -384,7 +384,7 @@ A json object with the following properties (order does not matter) * **dbConfigPw** : (string) -''- but for the config table * **dbConfigTableName**: (string) the table name with the configuration (the *dbServer* and *dbName* options are used) -* **environmentVars** : (string, \r\n separate (phpmyadmin will auto use \r\n if you press enter)d, key value pairs are separated by = OR NULL) the environment variables for the test runner. All environment vars are cleared and only these are set (even if this is the empty string). The special delimiters `\n` and `=` must not be used inside keys or values. +* **environmentVars** : (string, \r\n or \n separated, key value pairs are separated by = OR NULL) the environment variables for the test runner. All environment vars are cleared and only these are set (even if this is the empty string). The special delimiters `\n` and `=` must not be used inside keys or values. The test runner is called and these environment variables are set. You can use `"path""` to escape paths or other strings It is recommended that you at least specify the following: `USER, HOME ,PATH` @@ -415,7 +415,7 @@ If the config table has more than 1 row, the first row is taken! "maxNumberOfTestsWithOneRequest": 20, "runner": "\"C:\\Program Files (x86)\\JetBrains\\IntelliJ IDEA 14.1.4\\jdk1.8.0_65\\bin\\java\" -cp \"C:\\Users\\theju\\Documents\\WebProjects\\SyndromeAll\\DefaultTestRunner\\out\\production\\DefaultTestRunner\" Main", - "environmentVars": "USER=yapextester\r\nHOME=/home/yapextester\r\nPWD=\r\nLANG=de_DE.UTF-8\r\nPATH=/usr/local/bin:/usr/bin:/bin:/" + "environmentVars": "USER=yapextester\nHOME=/home/yapextester\nLANG=de_DE.UTF-8\nPATH=/usr/local/bin:/usr/bin:/bin:/" } ``` -- GitLab