File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ HOST/PATH ini sections test for cli
3
+ --SKIPIF--
4
+ <?php
5
+ if (!getenv ("TEST_PHP_EXECUTABLE " )) die ("skip TEST_PHP_EXECUTABLE not set " );
6
+ if (substr (PHP_OS , 0 , 3 ) == "WIN " ) die ("skip non windows test " );
7
+ ?>
8
+ --FILE--
9
+ <?php
10
+ $ php = getenv ("TEST_PHP_EXECUTABLE " );
11
+ $ cwd = getcwd ();
12
+ $ ini_file = __DIR__ . "/023.ini " ;
13
+ file_put_contents ($ ini_file , <<<INI
14
+ ; no sections should match as cli doesn't support any
15
+ memory_limit = 40M
16
+ [PATH= {$ cwd }]
17
+ memory_limit = 50M
18
+ [PATH=/does/not/exist]
19
+ memory_limit = 60M
20
+ [HOST=some_fake_host]
21
+ memory_limit = 70M
22
+ INI
23
+ );
24
+ $ desc = array (
25
+ 0 => array ("pipe " , "r " ),
26
+ 1 => array ("pipe " , "w " ),
27
+ 2 => array ("pipe " , "w " ),
28
+ );
29
+ $ pipes = array ();
30
+ $ proc = proc_open ("$ php -c $ ini_file -r 'echo ini_get( \"memory_limit \");' " , $ desc , $ pipes );
31
+ if (!$ proc ) {
32
+ exit (1 );
33
+ }
34
+ var_dump (stream_get_contents ($ pipes [1 ]));
35
+ var_dump (stream_get_contents ($ pipes [2 ]));
36
+
37
+ proc_terminate ($ proc );
38
+ proc_close ($ proc );
39
+ ?>
40
+ --CLEAN--
41
+ <?php
42
+ unlink (__DIR__ . "/023.ini " );
43
+ ?>
44
+ --EXPECTF--
45
+ string(3) "40M"
46
+ string(0) ""
You can’t perform that action at this time.
0 commit comments