1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
From 7fc722c993ca01038dbfd52439891dd6f21b34e9 Mon Sep 17 00:00:00 2001
From: Remi Collet <fedora@famillecollet.com>
Date: Wed, 17 Jun 2015 14:06:52 +0200
Subject: [PATCH 1/2] honours TEST_PHP_ARGS (which can include other extension,
json, msgpack, ...)
---
tests/yar.inc | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tests/yar.inc b/tests/yar.inc
index 467efe3..bd76ac1 100644
--- a/tests/yar.inc
+++ b/tests/yar.inc
@@ -10,7 +10,11 @@ define("YAR_API_URI", "/");
define("YAR_API_ADDRESS", "http://" . YAR_API_HOST . YAR_API_URI);
function yar_server_start($doc_root = __DIR__ . "/htdocs", $cmd_args = "-dextension=" . __DIR__ . "/../modules/yar.so") {
- $php_executable = getenv('TEST_PHP_EXECUTABLE');
+ $php_executable = (getenv('TEST_PHP_EXECUTABLE')?:PHP_BINARY);
+ $tmp = getenv('TEST_PHP_ARGS');
+ if ($tmp) {
+ $cmd_args = $tmp;
+ }
$descriptorspec = array(
0 => STDIN,
From a2b79d399a6eb666f4873a42ce8cbf0cfb3b86b0 Mon Sep 17 00:00:00 2001
From: Remi Collet <fedora@famillecollet.com>
Date: Wed, 17 Jun 2015 14:09:34 +0200
Subject: [PATCH 2/2] use ENV if defined for hostname and port (make
downstream)
---
tests/yar.inc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/yar.inc b/tests/yar.inc
index bd76ac1..e7161e2 100644
--- a/tests/yar.inc
+++ b/tests/yar.inc
@@ -3,8 +3,8 @@
define("YAR_API_USER", "dummy");
define("YAR_API_PASS", "foo");
-define("YAR_API_HOSTNAME", "localhost");
-define("YAR_API_PORT", "8964");
+define("YAR_API_HOSTNAME", (getenv('YAR_API_HOSTNAME') ?: "localhost"));
+define("YAR_API_PORT", (getenv('YAR_API_PORT') ?: "8964"));
define("YAR_API_HOST", YAR_API_HOSTNAME . ":" . YAR_API_PORT);
define("YAR_API_URI", "/");
define("YAR_API_ADDRESS", "http://" . YAR_API_HOST . YAR_API_URI);
|