From 4ce39c75c770716e2d0cdf5d313ff32b6326e6f9 Mon Sep 17 00:00:00 2001 From: "Jasper N. Brouwer" Date: Thu, 11 May 2017 21:56:42 +0200 Subject: [PATCH] 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" --- src/Composer/EventDispatcher/EventDispatcher.php | 6 ++++-- src/Composer/XdebugHandler.php | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Composer/EventDispatcher/EventDispatcher.php b/src/Composer/EventDispatcher/EventDispatcher.php index 63ef134aa..cd815112b 100644 --- a/src/Composer/EventDispatcher/EventDispatcher.php +++ b/src/Composer/EventDispatcher/EventDispatcher.php @@ -257,9 +257,11 @@ class EventDispatcher 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; } /** diff --git a/src/Composer/XdebugHandler.php b/src/Composer/XdebugHandler.php index dae3ee840..f7fd8c2a1 100644 --- a/src/Composer/XdebugHandler.php +++ b/src/Composer/XdebugHandler.php @@ -174,6 +174,8 @@ class XdebugHandler $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; if (defined('PHP_WINDOWS_VERSION_BUILD')) {