in src/Configuration/ConfigurationResolver.php [101:148]
public static function ini(
$key,
$expectedType,
$profile = null,
$filename = null,
$options = []
){
$filename = $filename ?: (self::getDefaultConfigFilename());
$profile = $profile ?: (getenv(self::ENV_PROFILE) ?: 'default');
if (!@is_readable($filename)) {
return null;
}
// Use INI_SCANNER_NORMAL instead of INI_SCANNER_TYPED for PHP 5.5 compatibility
//TODO change after deprecation
$data = @\Aws\parse_ini_file($filename, true, INI_SCANNER_NORMAL);
if (isset($options['section'])
&& isset($options['subsection'])
&& isset($options['key']))
{
return self::retrieveValueFromIniSubsection(
$data,
$profile,
$filename,
$expectedType,
$options
);
}
if ($data === false
|| !isset($data[$profile])
|| !isset($data[$profile][$key])
) {
return null;
}
// INI_SCANNER_NORMAL parses false-y values as an empty string
if ($data[$profile][$key] === "") {
if ($expectedType === 'bool') {
$data[$profile][$key] = false;
} elseif ($expectedType === 'int') {
$data[$profile][$key] = 0;
}
}
return self::convertType($data[$profile][$key], $expectedType);
}