original_string: public static function createDistribution($bucket, $enabled = true, $cnames = array(), $comment = null, $defaultRootObject = null, $originAccessIdentity = null, $trustedSigners = array())
  	{
  		if (!extension_loaded('openssl'))
  		{
  			self::__triggerError(sprintf("S3::createDistribution({$bucket}, ".(int)$enabled.", [], '$comment'): %s",
  			"CloudFront functionality requires SSL"), __FILE__, __LINE__);
  			return false;
  		}
  		$useSSL = self::$useSSL;
  
  		self::$useSSL = true; // CloudFront requires SSL
  		$rest = new S3Request('POST', '', '2010-11-01/distribution', 'cloudfront.amazonaws.com');
  		$rest->data = self::__getCloudFrontDistributionConfigXML(
  			$bucket.'.s3.amazonaws.com',
  			$enabled,
  			(string)$comment,
  			(string)microtime(true),
  			$cnames,
  			$defaultRootObject,
  			$originAccessIdentity,
  			$trustedSigners
  		);
  
  		$rest->size = strlen($rest->data);
  		$rest->setHeader('Content-Type', 'application/xml');
  		$rest = self::__getCloudFrontResponse($rest);
  
  		self::$useSSL = $useSSL;
  
  		if ($rest->error === false && $rest->code !== 201)
  			$rest->error = array('code' => $rest->code, 'message' => 'Unexpected HTTP status');
  		if ($rest->error !== false)
  		{
  			self::__triggerError(sprintf("S3::createDistribution({$bucket}, ".(int)$enabled.", [], '$comment'): [%s] %s",
  			$rest->error['code'], $rest->error['message']), __FILE__, __LINE__);
  			return false;
  		} elseif ($rest->body instanceof SimpleXMLElement)
  			return self::__parseCloudFrontDistributionConfig($rest->body);
  		return false;
  	}
code: public static function createDistribution($bucket, $enabled = true, $cnames = array(), $comment = null, $defaultRootObject = null, $originAccessIdentity = null, $trustedSigners = array())
  	{
  		if (!extension_loaded('openssl'))
  		{
  			self::__triggerError(sprintf("S3::createDistribution({$bucket}, ".(int)$enabled.", [], '$comment'): %s",
  			"CloudFront functionality requires SSL"), __FILE__, __LINE__);
  			return false;
  		}
  		$useSSL = self::$useSSL;
  
  		self::$useSSL = true; // CloudFront requires SSL
  		$rest = new S3Request('POST', '', '2010-11-01/distribution', 'cloudfront.amazonaws.com');
  		$rest->data = self::__getCloudFrontDistributionConfigXML(
  			$bucket.'.s3.amazonaws.com',
  			$enabled,
  			(string)$comment,
  			(string)microtime(true),
  			$cnames,
  			$defaultRootObject,
  			$originAccessIdentity,
  			$trustedSigners
  		);
  
  		$rest->size = strlen($rest->data);
  		$rest->setHeader('Content-Type', 'application/xml');
  		$rest = self::__getCloudFrontResponse($rest);
  
  		self::$useSSL = $useSSL;
  
  		if ($rest->error === false && $rest->code !== 201)
  			$rest->error = array('code' => $rest->code, 'message' => 'Unexpected HTTP status');
  		if ($rest->error !== false)
  		{
  			self::__triggerError(sprintf("S3::createDistribution({$bucket}, ".(int)$enabled.", [], '$comment'): [%s] %s",
  			$rest->error['code'], $rest->error['message']), __FILE__, __LINE__);
  			return false;
  		} elseif ($rest->body instanceof SimpleXMLElement)
  			return self::__parseCloudFrontDistributionConfig($rest->body);
  		return false;
  	}
code_tokens: public static function createDistribution ( $ bucket , $ enabled = true , $ cnames = array ( ) , $ comment = null , $ defaultRootObject = null , $ originAccessIdentity = null , $ trustedSigners = array ( ) ) { if ( ! extension_loaded ( 'openssl' ) ) { self :: __triggerError ( sprintf ( "S3::createDistribution({$bucket}, " . ( int ) $ enabled . ", [], '$comment'): %s" , "CloudFront functionality requires SSL" ) , __FILE__ , __LINE__ ) ; return false ; } $ useSSL = self :: $ useSSL ; self :: $ useSSL = true ; // CloudFront requires SSL $ rest = new S3Request ( 'POST' , '' , '2010-11-01/distribution' , 'cloudfront.amazonaws.com' ) ; $ rest -> data = self :: __getCloudFrontDistributionConfigXML ( $ bucket . '.s3.amazonaws.com' , $ enabled , ( string ) $ comment , ( string ) microtime ( true ) , $ cnames , $ defaultRootObject , $ originAccessIdentity , $ trustedSigners ) ; $ rest -> size = strlen ( $ rest -> data ) ; $ rest -> setHeader ( 'Content-Type' , 'application/xml' ) ; $ rest = self :: __getCloudFrontResponse ( $ rest ) ; self :: $ useSSL = $ useSSL ; if ( $ rest -> error === false && $ rest -> code !== 201 ) $ rest -> error = array ( 'code' => $ rest -> code , 'message' => 'Unexpected HTTP status' ) ; if ( $ rest -> error !== false ) { self :: __triggerError ( sprintf ( "S3::createDistribution({$bucket}, " . ( int ) $ enabled . ", [], '$comment'): [%s] %s" , $ rest -> error [ 'code' ] , $ rest -> error [ 'message' ] ) , __FILE__ , __LINE__ ) ; return false ; } elseif ( $ rest -> body instanceof SimpleXMLElement ) return self :: __parseCloudFrontDistributionConfig ( $ rest -> body ) ; return false ; }
docstring: Create a CloudFront distribution
  
  @param string $bucket Bucket name
  @param boolean $enabled Enabled (true/false)
  @param array $cnames Array containing CNAME aliases
  @param string $comment Use the bucket name as the hostname
  @param string $defaultRootObject Default root object
  @param string $originAccessIdentity Origin access identity
  @param array $trustedSigners Array of trusted signers
  @return array | false
docstring_tokens: Create a CloudFront distribution