public static function createFromConnectionString($connectionString)
    {
        $tokenizedSettings = self::parseAndValidateKeys($connectionString);

        // Devstore case
        $matchedSpecs = self::matchedSpecification(
            $tokenizedSettings,
            self::allRequired(self::$useDevelopmentStorageSetting),
            self::optional(self::$developmentStorageProxyUriSetting)
        );
        if ($matchedSpecs) {
            $proxyUri = Utilities::tryGetValueInsensitive(
                Resources::DEVELOPMENT_STORAGE_PROXY_URI_NAME,
                $tokenizedSettings
            );

            return self::getDevelopmentStorageAccount($proxyUri);
        }

        // Automatic case
        $matchedSpecs = self::matchedSpecification(
            $tokenizedSettings,
            self::allRequired(
                self::$defaultEndpointsProtocolSetting,
                self::$accountNameSetting,
                self::$accountKeySetting
            ),
            self::optional(
                self::$blobEndpointSetting,
                self::$queueEndpointSetting,
                self::$tableEndpointSetting,
                self::$fileEndpointSetting,
                self::$endpointSuffixSetting
            )
        );
        if ($matchedSpecs) {
            $scheme         = Utilities::tryGetValueInsensitive(
                Resources::DEFAULT_ENDPOINTS_PROTOCOL_NAME,
                $tokenizedSettings
            );
            $accountName    = Utilities::tryGetValueInsensitive(
                Resources::ACCOUNT_NAME_NAME,
                $tokenizedSettings
            );
            $endpointSuffix = Utilities::tryGetValueInsensitive(
                Resources::ENDPOINT_SUFFIX_NAME,
                $tokenizedSettings
            );
            return self::createStorageServiceSettings(
                $tokenizedSettings,
                self::getServiceEndpoint(
                    $scheme,
                    $accountName,
                    Resources::BLOB_DNS_PREFIX,
                    $endpointSuffix
                ),
                self::getServiceEndpoint(
                    $scheme,
                    $accountName,
                    Resources::QUEUE_DNS_PREFIX,
                    $endpointSuffix
                ),
                self::getServiceEndpoint(
                    $scheme,
                    $accountName,
                    Resources::TABLE_DNS_PREFIX,
                    $endpointSuffix
                ),
                self::getServiceEndpoint(
                    $scheme,
                    $accountName,
                    Resources::FILE_DNS_PREFIX,
                    $endpointSuffix
                ),
                self::getServiceEndpoint(
                    $scheme,
                    $accountName,
                    Resources::BLOB_DNS_PREFIX,
                    $endpointSuffix,
                    true
                ),
                self::getServiceEndpoint(
                    $scheme,
                    $accountName,
                    Resources::QUEUE_DNS_PREFIX,
                    $endpointSuffix,
                    true
                ),
                self::getServiceEndpoint(
                    $scheme,
                    $accountName,
                    Resources::TABLE_DNS_PREFIX,
                    $endpointSuffix,
                    true
                ),
                self::getServiceEndpoint(
                    $scheme,
                    $accountName,
                    Resources::FILE_DNS_PREFIX,
                    $endpointSuffix,
                    true
                )
            );
        }

        // Explicit case for AccountName/AccountKey combination
        $matchedSpecs = self::matchedSpecification(
            $tokenizedSettings,
            self::atLeastOne(
                self::$blobEndpointSetting,
                self::$queueEndpointSetting,
                self::$tableEndpointSetting,
                self::$fileEndpointSetting
            ),
            self::allRequired(
                self::$accountNameSetting,
                self::$accountKeySetting
            )
        );
        if ($matchedSpecs) {
            return self::createStorageServiceSettings($tokenizedSettings);
        }

        // Explicit case for SAS token
        $matchedSpecs = self::matchedSpecification(
            $tokenizedSettings,
            self::atLeastOne(
                self::$blobEndpointSetting,
                self::$queueEndpointSetting,
                self::$tableEndpointSetting,
                self::$fileEndpointSetting
            ),
            self::allRequired(
                self::$sasTokenSetting
            )
        );
        if ($matchedSpecs) {
            return self::createStorageServiceSettings($tokenizedSettings);
        }

        self::noMatch($connectionString);
    }
public static function createFromConnectionString($connectionString)
    {
        $tokenizedSettings = self::parseAndValidateKeys($connectionString);

        // Devstore case
        $matchedSpecs = self::matchedSpecification(
            $tokenizedSettings,
            self::allRequired(self::$useDevelopmentStorageSetting),
            self::optional(self::$developmentStorageProxyUriSetting)
        );
        if ($matchedSpecs) {
            $proxyUri = Utilities::tryGetValueInsensitive(
                Resources::DEVELOPMENT_STORAGE_PROXY_URI_NAME,
                $tokenizedSettings
            );

            return self::getDevelopmentStorageAccount($proxyUri);
        }

        // Automatic case
        $matchedSpecs = self::matchedSpecification(
            $tokenizedSettings,
            self::allRequired(
                self::$defaultEndpointsProtocolSetting,
                self::$accountNameSetting,
                self::$accountKeySetting
            ),
            self::optional(
                self::$blobEndpointSetting,
                self::$queueEndpointSetting,
                self::$tableEndpointSetting,
                self::$fileEndpointSetting,
                self::$endpointSuffixSetting
            )
        );
        if ($matchedSpecs) {
            $scheme         = Utilities::tryGetValueInsensitive(
                Resources::DEFAULT_ENDPOINTS_PROTOCOL_NAME,
                $tokenizedSettings
            );
            $accountName    = Utilities::tryGetValueInsensitive(
                Resources::ACCOUNT_NAME_NAME,
                $tokenizedSettings
            );
            $endpointSuffix = Utilities::tryGetValueInsensitive(
                Resources::ENDPOINT_SUFFIX_NAME,
                $tokenizedSettings
            );
            return self::createStorageServiceSettings(
                $tokenizedSettings,
                self::getServiceEndpoint(
                    $scheme,
                    $accountName,
                    Resources::BLOB_DNS_PREFIX,
                    $endpointSuffix
                ),
                self::getServiceEndpoint(
                    $scheme,
                    $accountName,
                    Resources::QUEUE_DNS_PREFIX,
                    $endpointSuffix
                ),
                self::getServiceEndpoint(
                    $scheme,
                    $accountName,
                    Resources::TABLE_DNS_PREFIX,
                    $endpointSuffix
                ),
                self::getServiceEndpoint(
                    $scheme,
                    $accountName,
                    Resources::FILE_DNS_PREFIX,
                    $endpointSuffix
                ),
                self::getServiceEndpoint(
                    $scheme,
                    $accountName,
                    Resources::BLOB_DNS_PREFIX,
                    $endpointSuffix,
                    true
                ),
                self::getServiceEndpoint(
                    $scheme,
                    $accountName,
                    Resources::QUEUE_DNS_PREFIX,
                    $endpointSuffix,
                    true
                ),
                self::getServiceEndpoint(
                    $scheme,
                    $accountName,
                    Resources::TABLE_DNS_PREFIX,
                    $endpointSuffix,
                    true
                ),
                self::getServiceEndpoint(
                    $scheme,
                    $accountName,
                    Resources::FILE_DNS_PREFIX,
                    $endpointSuffix,
                    true
                )
            );
        }

        // Explicit case for AccountName/AccountKey combination
        $matchedSpecs = self::matchedSpecification(
            $tokenizedSettings,
            self::atLeastOne(
                self::$blobEndpointSetting,
                self::$queueEndpointSetting,
                self::$tableEndpointSetting,
                self::$fileEndpointSetting
            ),
            self::allRequired(
                self::$accountNameSetting,
                self::$accountKeySetting
            )
        );
        if ($matchedSpecs) {
            return self::createStorageServiceSettings($tokenizedSettings);
        }

        // Explicit case for SAS token
        $matchedSpecs = self::matchedSpecification(
            $tokenizedSettings,
            self::atLeastOne(
                self::$blobEndpointSetting,
                self::$queueEndpointSetting,
                self::$tableEndpointSetting,
                self::$fileEndpointSetting
            ),
            self::allRequired(
                self::$sasTokenSetting
            )
        );
        if ($matchedSpecs) {
            return self::createStorageServiceSettings($tokenizedSettings);
        }

        self::noMatch($connectionString);
    }
public static function createFromConnectionString ( $ connectionString ) { $ tokenizedSettings = self :: parseAndValidateKeys ( $ connectionString ) ; // Devstore case $ matchedSpecs = self :: matchedSpecification ( $ tokenizedSettings , self :: allRequired ( self :: $ useDevelopmentStorageSetting ) , self :: optional ( self :: $ developmentStorageProxyUriSetting ) ) ; if ( $ matchedSpecs ) { $ proxyUri = Utilities :: tryGetValueInsensitive ( Resources :: DEVELOPMENT_STORAGE_PROXY_URI_NAME , $ tokenizedSettings ) ; return self :: getDevelopmentStorageAccount ( $ proxyUri ) ; } // Automatic case $ matchedSpecs = self :: matchedSpecification ( $ tokenizedSettings , self :: allRequired ( self :: $ defaultEndpointsProtocolSetting , self :: $ accountNameSetting , self :: $ accountKeySetting ) , self :: optional ( self :: $ blobEndpointSetting , self :: $ queueEndpointSetting , self :: $ tableEndpointSetting , self :: $ fileEndpointSetting , self :: $ endpointSuffixSetting ) ) ; if ( $ matchedSpecs ) { $ scheme = Utilities :: tryGetValueInsensitive ( Resources :: DEFAULT_ENDPOINTS_PROTOCOL_NAME , $ tokenizedSettings ) ; $ accountName = Utilities :: tryGetValueInsensitive ( Resources :: ACCOUNT_NAME_NAME , $ tokenizedSettings ) ; $ endpointSuffix = Utilities :: tryGetValueInsensitive ( Resources :: ENDPOINT_SUFFIX_NAME , $ tokenizedSettings ) ; return self :: createStorageServiceSettings ( $ tokenizedSettings , self :: getServiceEndpoint ( $ scheme , $ accountName , Resources :: BLOB_DNS_PREFIX , $ endpointSuffix ) , self :: getServiceEndpoint ( $ scheme , $ accountName , Resources :: QUEUE_DNS_PREFIX , $ endpointSuffix ) , self :: getServiceEndpoint ( $ scheme , $ accountName , Resources :: TABLE_DNS_PREFIX , $ endpointSuffix ) , self :: getServiceEndpoint ( $ scheme , $ accountName , Resources :: FILE_DNS_PREFIX , $ endpointSuffix ) , self :: getServiceEndpoint ( $ scheme , $ accountName , Resources :: BLOB_DNS_PREFIX , $ endpointSuffix , true ) , self :: getServiceEndpoint ( $ scheme , $ accountName , Resources :: QUEUE_DNS_PREFIX , $ endpointSuffix , true ) , self :: getServiceEndpoint ( $ scheme , $ accountName , Resources :: TABLE_DNS_PREFIX , $ endpointSuffix , true ) , self :: getServiceEndpoint ( $ scheme , $ accountName , Resources :: FILE_DNS_PREFIX , $ endpointSuffix , true ) ) ; } // Explicit case for AccountName/AccountKey combination $ matchedSpecs = self :: matchedSpecification ( $ tokenizedSettings , self :: atLeastOne ( self :: $ blobEndpointSetting , self :: $ queueEndpointSetting , self :: $ tableEndpointSetting , self :: $ fileEndpointSetting ) , self :: allRequired ( self :: $ accountNameSetting , self :: $ accountKeySetting ) ) ; if ( $ matchedSpecs ) { return self :: createStorageServiceSettings ( $ tokenizedSettings ) ; } // Explicit case for SAS token $ matchedSpecs = self :: matchedSpecification ( $ tokenizedSettings , self :: atLeastOne ( self :: $ blobEndpointSetting , self :: $ queueEndpointSetting , self :: $ tableEndpointSetting , self :: $ fileEndpointSetting ) , self :: allRequired ( self :: $ sasTokenSetting ) ) ; if ( $ matchedSpecs ) { return self :: createStorageServiceSettings ( $ tokenizedSettings ) ; } self :: noMatch ( $ connectionString ) ; }
Creates a StorageServiceSettings object from the given connection string.

@param string $connectionString The storage settings connection string.

@return StorageServiceSettings
Creates a StorageServiceSettings object from the given connection string .