public static function getHome()
{
if ($custom = getenv('PHPBREW_HOME')) {
if (!file_exists($custom)) {
mkdir($custom, 0755, true);
}
return $custom;
}
if ($home = getenv('HOME')) {
$path = $home . DIRECTORY_SEPARATOR . '.phpbrew';
if (!file_exists($path)) {
mkdir($path, 0755, true);
}
return $path;
}
throw new Exception('Environment variable PHPBREW_HOME or HOME is required');
}