original_string: private static function __getCloudFrontDistributionConfigXML($bucket, $enabled, $comment, $callerReference = '0', $cnames = array(), $defaultRootObject = null, $originAccessIdentity = null, $trustedSigners = array())
  	{
  		$dom = new DOMDocument('1.0', 'UTF-8');
  		$dom->formatOutput = true;
  		$distributionConfig = $dom->createElement('DistributionConfig');
  		$distributionConfig->setAttribute('xmlns', 'http://cloudfront.amazonaws.com/doc/2010-11-01/');
  
  		$origin = $dom->createElement('S3Origin');
  		$origin->appendChild($dom->createElement('DNSName', $bucket));
  		if ($originAccessIdentity !== null) $origin->appendChild($dom->createElement('OriginAccessIdentity', $originAccessIdentity));
  		$distributionConfig->appendChild($origin);
  
  		if ($defaultRootObject !== null) $distributionConfig->appendChild($dom->createElement('DefaultRootObject', $defaultRootObject));
  
  		$distributionConfig->appendChild($dom->createElement('CallerReference', $callerReference));
  		foreach ($cnames as $cname)
  			$distributionConfig->appendChild($dom->createElement('CNAME', $cname));
  		if ($comment !== '') $distributionConfig->appendChild($dom->createElement('Comment', $comment));
  		$distributionConfig->appendChild($dom->createElement('Enabled', $enabled ? 'true' : 'false'));
  
  		$trusted = $dom->createElement('TrustedSigners');
  		foreach ($trustedSigners as $id => $type)
  			$trusted->appendChild($id !== '' ? $dom->createElement($type, $id) : $dom->createElement($type));
  		$distributionConfig->appendChild($trusted);
  
  		$dom->appendChild($distributionConfig);
  		//var_dump($dom->saveXML());
  		return $dom->saveXML();
  	}
code: private static function __getCloudFrontDistributionConfigXML($bucket, $enabled, $comment, $callerReference = '0', $cnames = array(), $defaultRootObject = null, $originAccessIdentity = null, $trustedSigners = array())
  	{
  		$dom = new DOMDocument('1.0', 'UTF-8');
  		$dom->formatOutput = true;
  		$distributionConfig = $dom->createElement('DistributionConfig');
  		$distributionConfig->setAttribute('xmlns', 'http://cloudfront.amazonaws.com/doc/2010-11-01/');
  
  		$origin = $dom->createElement('S3Origin');
  		$origin->appendChild($dom->createElement('DNSName', $bucket));
  		if ($originAccessIdentity !== null) $origin->appendChild($dom->createElement('OriginAccessIdentity', $originAccessIdentity));
  		$distributionConfig->appendChild($origin);
  
  		if ($defaultRootObject !== null) $distributionConfig->appendChild($dom->createElement('DefaultRootObject', $defaultRootObject));
  
  		$distributionConfig->appendChild($dom->createElement('CallerReference', $callerReference));
  		foreach ($cnames as $cname)
  			$distributionConfig->appendChild($dom->createElement('CNAME', $cname));
  		if ($comment !== '') $distributionConfig->appendChild($dom->createElement('Comment', $comment));
  		$distributionConfig->appendChild($dom->createElement('Enabled', $enabled ? 'true' : 'false'));
  
  		$trusted = $dom->createElement('TrustedSigners');
  		foreach ($trustedSigners as $id => $type)
  			$trusted->appendChild($id !== '' ? $dom->createElement($type, $id) : $dom->createElement($type));
  		$distributionConfig->appendChild($trusted);
  
  		$dom->appendChild($distributionConfig);
  		//var_dump($dom->saveXML());
  		return $dom->saveXML();
  	}
code_tokens: private static function __getCloudFrontDistributionConfigXML ( $ bucket , $ enabled , $ comment , $ callerReference = '0' , $ cnames = array ( ) , $ defaultRootObject = null , $ originAccessIdentity = null , $ trustedSigners = array ( ) ) { $ dom = new DOMDocument ( '1.0' , 'UTF-8' ) ; $ dom -> formatOutput = true ; $ distributionConfig = $ dom -> createElement ( 'DistributionConfig' ) ; $ distributionConfig -> setAttribute ( 'xmlns' , 'http://cloudfront.amazonaws.com/doc/2010-11-01/' ) ; $ origin = $ dom -> createElement ( 'S3Origin' ) ; $ origin -> appendChild ( $ dom -> createElement ( 'DNSName' , $ bucket ) ) ; if ( $ originAccessIdentity !== null ) $ origin -> appendChild ( $ dom -> createElement ( 'OriginAccessIdentity' , $ originAccessIdentity ) ) ; $ distributionConfig -> appendChild ( $ origin ) ; if ( $ defaultRootObject !== null ) $ distributionConfig -> appendChild ( $ dom -> createElement ( 'DefaultRootObject' , $ defaultRootObject ) ) ; $ distributionConfig -> appendChild ( $ dom -> createElement ( 'CallerReference' , $ callerReference ) ) ; foreach ( $ cnames as $ cname ) $ distributionConfig -> appendChild ( $ dom -> createElement ( 'CNAME' , $ cname ) ) ; if ( $ comment !== '' ) $ distributionConfig -> appendChild ( $ dom -> createElement ( 'Comment' , $ comment ) ) ; $ distributionConfig -> appendChild ( $ dom -> createElement ( 'Enabled' , $ enabled ? 'true' : 'false' ) ) ; $ trusted = $ dom -> createElement ( 'TrustedSigners' ) ; foreach ( $ trustedSigners as $ id => $ type ) $ trusted -> appendChild ( $ id !== '' ? $ dom -> createElement ( $ type , $ id ) : $ dom -> createElement ( $ type ) ) ; $ distributionConfig -> appendChild ( $ trusted ) ; $ dom -> appendChild ( $ distributionConfig ) ; //var_dump($dom->saveXML()); return $ dom -> saveXML ( ) ; }
docstring: Get a DistributionConfig DOMDocument
  
  http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/index.html?PutConfig.html
  
  @internal Used to create XML in createDistribution() and updateDistribution()
  @param string $bucket S3 Origin bucket
  @param boolean $enabled Enabled (true/false)
  @param string $comment Comment to append
  @param string $callerReference Caller reference
  @param array $cnames Array of CNAME aliases
  @param string $defaultRootObject Default root object
  @param string $originAccessIdentity Origin access identity
  @param array $trustedSigners Array of trusted signers
  @return string
docstring_tokens: Get a DistributionConfig DOMDocument