Amazon_S3_And_CloudFront::get_formatted_s3_info PHP Method

get_formatted_s3_info() public method

Return a formatted S3 info with display friendly defaults
public get_formatted_s3_info ( integer $id, array | null $s3object = null ) : array
$id integer
$s3object array | null
return array
    public function get_formatted_s3_info($id, $s3object = null)
    {
        if (is_null($s3object)) {
            if (!($s3object = $this->get_attachment_s3_info($id))) {
                return false;
            }
        }
        $s3object['url'] = $this->get_attachment_s3_url($id, $s3object);
        $acl = isset($s3object['acl']) ? $s3object['acl'] : self::DEFAULT_ACL;
        $acl_info = array('acl' => $acl, 'name' => $this->get_acl_display_name($acl), 'title' => $this->get_media_action_strings('change_to_private'));
        if (self::PRIVATE_ACL === $acl) {
            $acl_info['title'] = $this->get_media_action_strings('change_to_public');
        }
        $s3object['acl'] = $acl_info;
        $regions = $this->get_aws_regions();
        if (isset($s3object['region']) && '' == $s3object['region']) {
            $s3object['region'] = self::DEFAULT_REGION;
        }
        if (isset($regions[$s3object['region']])) {
            $s3object['region'] = $regions[$s3object['region']];
        }
        return $s3object;
    }
Amazon_S3_And_CloudFront