Selaa lähdekoodia

Pass more ini directives when executing php

Not only pass the current value for "memory_limit" along when executing
php, but also do the same for "allow_url_fopen" and "disable_functions"
Jasper N. Brouwer 8 vuotta sitten
vanhempi
commit
4ce39c75c7

+ 4 - 2
src/Composer/EventDispatcher/EventDispatcher.php

@@ -257,9 +257,11 @@ class EventDispatcher
             throw new \RuntimeException('Failed to locate PHP binary to execute '.$scriptName);
             throw new \RuntimeException('Failed to locate PHP binary to execute '.$scriptName);
         }
         }
 
 
-        $memoryFlag = ' -d memory_limit='.ini_get('memory_limit');
+        $allowUrlFOpenFlag = ' -d allow_url_fopen=' . ini_get('allow_url_fopen');
+        $disableFunctionsFlag = ' -d disable_functions="' . ini_get('disable_functions') . '"';
+        $memoryLimitFlag = ' -d memory_limit=' . ini_get('memory_limit');
 
 
-        return ProcessExecutor::escape($phpPath) . $memoryFlag;
+        return ProcessExecutor::escape($phpPath) . $allowUrlFOpenFlag . $disableFunctionsFlag . $memoryLimitFlag;
     }
     }
 
 
     /**
     /**

+ 2 - 0
src/Composer/XdebugHandler.php

@@ -174,6 +174,8 @@ class XdebugHandler
             $content .= $data.PHP_EOL;
             $content .= $data.PHP_EOL;
         }
         }
 
 
+        $content .= 'allow_url_fopen='.ini_get('allow_url_fopen').PHP_EOL;
+        $content .= 'disable_functions="'.ini_get('disable_functions').'"'.PHP_EOL;
         $content .= 'memory_limit='.ini_get('memory_limit').PHP_EOL;
         $content .= 'memory_limit='.ini_get('memory_limit').PHP_EOL;
 
 
         if (defined('PHP_WINDOWS_VERSION_BUILD')) {
         if (defined('PHP_WINDOWS_VERSION_BUILD')) {