Amazon_S3_And_CloudFront::get_aws_regions PHP Method

get_aws_regions() public method

Get all AWS regions
public get_aws_regions ( ) : array
return array
    function get_aws_regions()
    {
        $regionEnum = new ReflectionClass('Aws\\Common\\Enum\\Region');
        $all_regions = $regionEnum->getConstants();
        $regions = array();
        foreach ($all_regions as $label => $region) {
            // Nicely format region name
            if (self::DEFAULT_REGION === $region) {
                $label = 'US Standard';
            } else {
                $label = strtolower($label);
                $label = str_replace('_', ' ', $label);
                $label = ucwords($label);
            }
            $regions[$region] = $label;
        }
        return $regions;
    }
Amazon_S3_And_CloudFront