updateDistribution() public static method

Update a CloudFront distribution
public static updateDistribution ( array $dist ) : array | false
$dist array Distribution array info identical to output of getDistribution()
return array | false | false
Example #1
0
function test_updateDistribution($distributionId, $enabled = false, $cnames = array())
{
    // To enable/disable a distribution configuration:
    if (($dist = S3::getDistribution($distributionId)) !== false) {
        $dist['enabled'] = $enabled;
        $dist['comment'] = $enabled ? 'Enabled' : 'Disabled';
        if (!isset($dist['cnames'])) {
            $dist['cnames'] = array();
        }
        foreach ($cnames as $cname) {
            $dist['cnames'][$cname] = $cname;
        }
        echo "updateDistribution({$distributionId}): ";
        var_dump(S3::updateDistribution($dist));
    } else {
        echo "getDistribution({$distributionId}): Failed to get distribution information for update\n";
    }
}