public static function putPathEnvFor($buildName)
{
$root = self::getRoot();
$buildDir = $root . DIRECTORY_SEPARATOR . 'php' . DIRECTORY_SEPARATOR . $buildName;
// re-build path
$paths = explode(PATH_SEPARATOR, getenv('PATH'));
$paths = array_filter($paths, function ($p) use($root) {
return strpos($p, $root) === false;
});
array_unshift($paths, $buildDir . DIRECTORY_SEPARATOR . 'bin');
putenv('PATH=' . implode(PATH_SEPARATOR, $paths));
}