public static function getDataService(array $instanceConfig)
    {
        $instanceDetails = parse_url($instanceConfig['Instance']);

        if (isset($instanceDetails['host']) === false || isset($instanceDetails['scheme']) === false) {
            $exceptionMessage = sprintf('Error while parsing instance configuration "%s"', $instanceConfig['Instance']);
            throw new \RuntimeException($exceptionMessage, 1415453791);
        }

        if (!array_key_exists('port', $instanceDetails)) {
            $instanceDetails['port'] = null;
        }

        $instanceConfig['Instance'] = $instanceDetails;

        $scheme = strtoupper($instanceConfig['Instance']['scheme']);
        switch ($scheme) {
            case 'SSH':
                $dataService = static::bootstrapSSHDataService($instanceConfig);
                break;
            case 'HTTPS':
            case 'HTTP':
                unset($instanceConfig['KeyFile']);
                $dataService = static::bootstrapHTTPDataService($instanceConfig);
                break;
            default:
                $exceptionMessage = sprintf('Data service for scheme "%s" is not available', $scheme);
                throw new \RuntimeException($exceptionMessage, 1364130057);
        }

        return $dataService;
    }
public static function getDataService(array $instanceConfig)
    {
        $instanceDetails = parse_url($instanceConfig['Instance']);

        if (isset($instanceDetails['host']) === false || isset($instanceDetails['scheme']) === false) {
            $exceptionMessage = sprintf('Error while parsing instance configuration "%s"', $instanceConfig['Instance']);
            throw new \RuntimeException($exceptionMessage, 1415453791);
        }

        if (!array_key_exists('port', $instanceDetails)) {
            $instanceDetails['port'] = null;
        }

        $instanceConfig['Instance'] = $instanceDetails;

        $scheme = strtoupper($instanceConfig['Instance']['scheme']);
        switch ($scheme) {
            case 'SSH':
                $dataService = static::bootstrapSSHDataService($instanceConfig);
                break;
            case 'HTTPS':
            case 'HTTP':
                unset($instanceConfig['KeyFile']);
                $dataService = static::bootstrapHTTPDataService($instanceConfig);
                break;
            default:
                $exceptionMessage = sprintf('Data service for scheme "%s" is not available', $scheme);
                throw new \RuntimeException($exceptionMessage, 1364130057);
        }

        return $dataService;
    }
public static function getDataService ( array $ instanceConfig ) { $ instanceDetails = parse_url ( $ instanceConfig [ 'Instance' ] ) ; if ( isset ( $ instanceDetails [ 'host' ] ) === false || isset ( $ instanceDetails [ 'scheme' ] ) === false ) { $ exceptionMessage = sprintf ( 'Error while parsing instance configuration "%s"' , $ instanceConfig [ 'Instance' ] ) ; throw new \ RuntimeException ( $ exceptionMessage , 1415453791 ) ; } if ( ! array_key_exists ( 'port' , $ instanceDetails ) ) { $ instanceDetails [ 'port' ] = null ; } $ instanceConfig [ 'Instance' ] = $ instanceDetails ; $ scheme = strtoupper ( $ instanceConfig [ 'Instance' ] [ 'scheme' ] ) ; switch ( $ scheme ) { case 'SSH' : $ dataService = static :: bootstrapSSHDataService ( $ instanceConfig ) ; break ; case 'HTTPS' : case 'HTTP' : unset ( $ instanceConfig [ 'KeyFile' ] ) ; $ dataService = static :: bootstrapHTTPDataService ( $ instanceConfig ) ; break ; default : $ exceptionMessage = sprintf ( 'Data service for scheme "%s" is not available' , $ scheme ) ; throw new \ RuntimeException ( $ exceptionMessage , 1364130057 ) ; } return $ dataService ; }
Main factory method to get a data service based on the incoming instance config.

$instanceConfig is an array in the structure:
[
'Instance' => [
'scheme' => "ssh",
'host' => "review.typo3.org",
'port' => 29418,
'user' => "max.mustermann",
...
],
'KeyFile' => null | /Path/To/Key/File
]

The KeyFile attribute is not needed for the HTTP data service.

@param array $instanceConfig
@return HTTPDataService|SSHDataService
@throws \RuntimeException
Main factory method to get a data service based on the incoming instance config .