#!/usr/bin/env php &$argument) { $argument = $applyMapping($argument); } // Get allowed environment variables $allowedEnv = array('XDEBUG_CONFIG', 'IDE_PHPUNIT_CUSTOM_LOADER', 'IDE_PHPUNIT_PHPUNIT_PHAR', 'IDE_PHPUNIT_PHPUNIT_INCLUDE'); $env = array(); foreach ($_SERVER as $name => $value) { if (in_array($name, $allowedEnv)) { $env[] = $name . '=' . $applyMapping($value); } } $includePaths = array('.', $projectDirGuest . '/vendor/phpunit/phpunit'); $arguments = array_merge(array('-d', 'include_path=' . implode(':', $includePaths)), $arguments); passthru($pipe . escapeshellarg($commandPrefix. ' ' . implode(' ', $env) . ' php ' . implode(' ', $arguments))); // Copy output files to their location, adapt paths foreach ($coverageFileList as $filePath => $hostPath) { if (!file_exists($hostPath)) { @unlink($filePath); } else { $contents = file_get_contents($hostPath); $contents = str_replace($projectDirGuest, $projectDirHost, $contents); file_put_contents($filePath, $contents); } }