diff --git a/src/system/modules/!composer/src/Controller/UpdatePackagesController.php b/src/system/modules/!composer/src/Controller/UpdatePackagesController.php index 1a0f0f3..3308dcd 100644 --- a/src/system/modules/!composer/src/Controller/UpdatePackagesController.php +++ b/src/system/modules/!composer/src/Controller/UpdatePackagesController.php @@ -8,6 +8,7 @@ * @copyright ContaoCommunityAlliance 2013 * @author Christian Schiffler * @author Tristan Lins + * @author Fritz Michael Gschwantner * @package Composer * @license LGPLv3 * @filesource @@ -240,7 +241,21 @@ protected function runDetached($packages, $dryRun) escapeshellarg(TL_ROOT . '/' . DetachedController::OUT_FILE_PATHNAME) ); - $processId = shell_exec($cmd); + if (substr(php_uname(), 0, 7) == "Windows") { + $proc = proc_open( + $cmd, + array( + array('pipe', 'r'), + array('pipe', 'w'), + array('pipe', 'w') + ), + $pipes + ); + $procStatus = proc_get_status($proc); + $processId = $procStatus['pid']; + } else { + $processId = shell_exec($cmd); + } $pidFile = new \File(DetachedController::PID_FILE_PATHNAME); $pidFile->write(trim($processId)); @@ -270,6 +285,8 @@ private function determineRuntimeMode() $functions = array('shell_exec'); if (!defined('PHP_WINDOWS_VERSION_BUILD')) { $functions[] = 'posix_kill'; + } else { + $functions[] = 'proc_open'; } }