public static function getEnv($name)
    {
        $envs = [];
        $output = self::runCommand('env', [$name]);
        if (trim($output->getOutput()) == "$name is not running. Please start this with docker-machine start $name") {
            throw new \Exception('Docker machine has not been started yet.');
        }
        $envOutput = explode(PHP_EOL, $output->getOutput());
        foreach ($envOutput as $line) {
            if (strpos($line, 'export') !== false) {
                list(, $export) = explode(' ', $line, 2);
                list($key, $value) = explode('=', $export, 2);
                $envs[$key] = str_replace('"', '', $value);
            }
        }
        return $envs;
    }
public static function getEnv($name)
    {
        $envs = [];
        $output = self::runCommand('env', [$name]);
        if (trim($output->getOutput()) == "$name is not running. Please start this with docker-machine start $name") {
            throw new \Exception('Docker machine has not been started yet.');
        }
        $envOutput = explode(PHP_EOL, $output->getOutput());
        foreach ($envOutput as $line) {
            if (strpos($line, 'export') !== false) {
                list(, $export) = explode(' ', $line, 2);
                list($key, $value) = explode('=', $export, 2);
                $envs[$key] = str_replace('"', '', $value);
            }
        }
        return $envs;
    }
public static function getEnv ( $ name ) { $ envs = [ ] ; $ output = self :: runCommand ( 'env' , [ $ name ] ) ; if ( trim ( $ output -> getOutput ( ) ) == "$name is not running. Please start this with docker-machine start $name" ) { throw new \ Exception ( 'Docker machine has not been started yet.' ) ; } $ envOutput = explode ( PHP_EOL , $ output -> getOutput ( ) ) ; foreach ( $ envOutput as $ line ) { if ( strpos ( $ line , 'export' ) !== false ) { list ( , $ export ) = explode ( ' ' , $ line , 2 ) ; list ( $ key , $ value ) = explode ( '=' , $ export , 2 ) ; $ envs [ $ key ] = str_replace ( '"' , '' , $ value ) ; } } return $ envs ; }
Returns an array of the environment for the Docker client.

@param $name
@return array
@throws \Exception
Returns an array of the environment for the Docker client .