Scalr\Service\Aws\S3\Handler\BucketHandler::setCors PHP Méthode

setCors() public méthode

Sets the cors configuration for your bucket. If the configuration exists, Amazon S3 replaces it.
public setCors ( BucketData | string $bucketName, string $cors ) : boolean
$bucketName Scalr\Service\Aws\S3\DataType\BucketData | string A bucket name.
$cors string A XML document that defines Cors configuration.
Résultat boolean Returns true on succes or false if failure.
    public function setCors($bucketName, $cors)
    {
        if ($bucketName instanceof BucketData) {
            $bucketName = $bucketName->bucketName;
        }
        return $this->getS3()->getApiHandler()->setBucketCors($bucketName, $cors);
    }