File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed
Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -6,18 +6,33 @@ com_dotnet
66<?php
77// To actually be able to verify the crash during shutdown on Windows, we have
88// to execute a PHP subprocess, and check its exit status.
9+
10+ // First we determine whether com_dotnet would be loaded in the subprocess
911$ php = getenv ('TEST_PHP_EXECUTABLE_ESCAPED ' );
10- $ extension_dir = escapeshellarg (ini_get ("extension_dir " ));
1112$ script = <<<SCRIPT
12- if (!extension_loaded('com_dotnet')) dl('com_dotnet');
13+ echo extension_loaded('com_dotnet') ? 'yes' : 'no';
14+ SCRIPT ;
15+ exec ("$ php -r \"$ script \"" , $ output );
16+ var_dump (isset ($ output [0 ]));
17+ $ loaded = $ output [0 ] === "yes " ;
18+ $ output = null ;
19+
20+ // Then we run the subprocess with com_dotnet loaded
21+ $ script = <<<SCRIPT
1322ini_set('com.autoregister_typelib', '1');
1423new COM('WbemScripting.SWbemLocator');
1524SCRIPT ;
16- $ command = "$ php -d extension_dir= $ extension_dir -r \"$ script \"" ;
25+ if ($ loaded ) {
26+ $ command = "$ php -r \"$ script \"" ;
27+ } else {
28+ $ extension_dir = escapeshellarg (ini_get ("extension_dir " ));
29+ $ command = "$ php -d extension_dir= $ extension_dir -d extension=com_dotnet -r \"$ script \"" ;
30+ }
1731exec ($ command , $ output , $ status );
1832var_dump ($ output , $ status );
1933?>
2034--EXPECT--
35+ bool(true)
2136array(0) {
2237}
2338int(0)
You can’t perform that action at this time.
0 commit comments