diff --git a/bootstrap.php b/bootstrap.php index dc03cf64a334e86f0b439b1e50439a0129ada16e..0b12d7f57294ad7d8ede658c32917012616bbb62 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 48699b08f48b45f518f2b3f142cf329f501089be..78ce575d12dd8e7a7613624183e3e42ac119abc6 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:/" } ```