src/EndpointDiscovery/ConfigurationProvider.php
public static function ini(
        $profile = null,
        $filename = null,
        $cacheLimit = self::DEFAULT_CACHE_LIMIT
    ) {
        $filename = $filename ?: (self::getHomeDir() . '/.aws/config');
        $profile = $profile ?: (getenv(self::ENV_PROFILE) ?: 'default');

        return function () use ($profile, $filename, $cacheLimit) {
            if (!is_readable($filename)) {
                return self::reject("Cannot read configuration from $filename");
            }
            $data = \Aws\parse_ini_file($filename, true);
            if ($data === false) {
                return self::reject("Invalid config file: $filename");
            }
            if (!isset($data[$profile])) {
                return self::reject("'$profile' not found in config file");
            }
            if (!isset($data[$profile]['endpoint_discovery_enabled'])) {
                return self::reject("Required endpoint discovery config values 
                    not present in INI profile '{$profile}' ({$filename})");
            }

            return Promise\promise_for(
                new Configuration(
                    $data[$profile]['endpoint_discovery_enabled'],
                    $cacheLimit
                )
            );
        };
    }
public static function ini(
        $profile = null,
        $filename = null,
        $cacheLimit = self::DEFAULT_CACHE_LIMIT
    ) {
        $filename = $filename ?: (self::getHomeDir() . '/.aws/config');
        $profile = $profile ?: (getenv(self::ENV_PROFILE) ?: 'default');

        return function () use ($profile, $filename, $cacheLimit) {
            if (!is_readable($filename)) {
                return self::reject("Cannot read configuration from $filename");
            }
            $data = \Aws\parse_ini_file($filename, true);
            if ($data === false) {
                return self::reject("Invalid config file: $filename");
            }
            if (!isset($data[$profile])) {
                return self::reject("'$profile' not found in config file");
            }
            if (!isset($data[$profile]['endpoint_discovery_enabled'])) {
                return self::reject("Required endpoint discovery config values 
                    not present in INI profile '{$profile}' ({$filename})");
            }

            return Promise\promise_for(
                new Configuration(
                    $data[$profile]['endpoint_discovery_enabled'],
                    $cacheLimit
                )
            );
        };
    }
public static function ini ( $ profile = null , $ filename = null , $ cacheLimit = self :: DEFAULT_CACHE_LIMIT ) { $ filename = $ filename ? : ( self :: getHomeDir ( ) . '/.aws/config' ) ; $ profile = $ profile ? : ( getenv ( self :: ENV_PROFILE ) ? : 'default' ) ; return function ( ) use ( $ profile , $ filename , $ cacheLimit ) { if ( ! is_readable ( $ filename ) ) { return self :: reject ( "Cannot read configuration from $filename" ) ; } $ data = \ Aws \ parse_ini_file ( $ filename , true ) ; if ( $ data === false ) { return self :: reject ( "Invalid config file: $filename" ) ; } if ( ! isset ( $ data [ $ profile ] ) ) { return self :: reject ( "'$profile' not found in config file" ) ; } if ( ! isset ( $ data [ $ profile ] [ 'endpoint_discovery_enabled' ] ) ) { return self :: reject ( "Required endpoint discovery config values 
                    not present in INI profile '{$profile}' ({$filename})" ) ; } return Promise \ promise_for ( new Configuration ( $ data [ $ profile ] [ 'endpoint_discovery_enabled' ] , $ cacheLimit ) ) ; } ; }
Config provider that creates config using an ini file stored
in the current user's home directory.

@param string|null $profile  Profile to use. If not specified will use
the "default" profile in "~/.aws/config".
@param string|null $filename If provided, uses a custom filename rather
than looking in the home directory.
@param int $cacheLimit

@return callable
Config provider that creates config using an ini file stored in the current user s home directory .