original_string: public static function getAccessControlPolicy($bucket, $uri = '')
  	{
  		$rest = new S3Request('GET', $bucket, $uri, self::$endpoint);
  		$rest->setParameter('acl', null);
  		$rest = $rest->getResponse();
  		if ($rest->error === false && $rest->code !== 200)
  			$rest->error = array('code' => $rest->code, 'message' => 'Unexpected HTTP status');
  		if ($rest->error !== false)
  		{
  			self::__triggerError(sprintf("S3::getAccessControlPolicy({$bucket}, {$uri}): [%s] %s",
  			$rest->error['code'], $rest->error['message']), __FILE__, __LINE__);
  			return false;
  		}
  
  		$acp = array();
  		if (isset($rest->body->Owner, $rest->body->Owner->ID, $rest->body->Owner->DisplayName))
  			$acp['owner'] = array(
  				'id' => (string)$rest->body->Owner->ID, 'name' => (string)$rest->body->Owner->DisplayName
  			);
  
  		if (isset($rest->body->AccessControlList))
  		{
  			$acp['acl'] = array();
  			foreach ($rest->body->AccessControlList->Grant as $grant)
  			{
  				foreach ($grant->Grantee as $grantee)
  				{
  					if (isset($grantee->ID, $grantee->DisplayName)) // CanonicalUser
  						$acp['acl'][] = array(
  							'type' => 'CanonicalUser',
  							'id' => (string)$grantee->ID,
  							'name' => (string)$grantee->DisplayName,
  							'permission' => (string)$grant->Permission
  						);
  					elseif (isset($grantee->EmailAddress)) // AmazonCustomerByEmail
  						$acp['acl'][] = array(
  							'type' => 'AmazonCustomerByEmail',
  							'email' => (string)$grantee->EmailAddress,
  							'permission' => (string)$grant->Permission
  						);
  					elseif (isset($grantee->URI)) // Group
  						$acp['acl'][] = array(
  							'type' => 'Group',
  							'uri' => (string)$grantee->URI,
  							'permission' => (string)$grant->Permission
  						);
  					else continue;
  				}
  			}
  		}
  		return $acp;
  	}
code: public static function getAccessControlPolicy($bucket, $uri = '')
  	{
  		$rest = new S3Request('GET', $bucket, $uri, self::$endpoint);
  		$rest->setParameter('acl', null);
  		$rest = $rest->getResponse();
  		if ($rest->error === false && $rest->code !== 200)
  			$rest->error = array('code' => $rest->code, 'message' => 'Unexpected HTTP status');
  		if ($rest->error !== false)
  		{
  			self::__triggerError(sprintf("S3::getAccessControlPolicy({$bucket}, {$uri}): [%s] %s",
  			$rest->error['code'], $rest->error['message']), __FILE__, __LINE__);
  			return false;
  		}
  
  		$acp = array();
  		if (isset($rest->body->Owner, $rest->body->Owner->ID, $rest->body->Owner->DisplayName))
  			$acp['owner'] = array(
  				'id' => (string)$rest->body->Owner->ID, 'name' => (string)$rest->body->Owner->DisplayName
  			);
  
  		if (isset($rest->body->AccessControlList))
  		{
  			$acp['acl'] = array();
  			foreach ($rest->body->AccessControlList->Grant as $grant)
  			{
  				foreach ($grant->Grantee as $grantee)
  				{
  					if (isset($grantee->ID, $grantee->DisplayName)) // CanonicalUser
  						$acp['acl'][] = array(
  							'type' => 'CanonicalUser',
  							'id' => (string)$grantee->ID,
  							'name' => (string)$grantee->DisplayName,
  							'permission' => (string)$grant->Permission
  						);
  					elseif (isset($grantee->EmailAddress)) // AmazonCustomerByEmail
  						$acp['acl'][] = array(
  							'type' => 'AmazonCustomerByEmail',
  							'email' => (string)$grantee->EmailAddress,
  							'permission' => (string)$grant->Permission
  						);
  					elseif (isset($grantee->URI)) // Group
  						$acp['acl'][] = array(
  							'type' => 'Group',
  							'uri' => (string)$grantee->URI,
  							'permission' => (string)$grant->Permission
  						);
  					else continue;
  				}
  			}
  		}
  		return $acp;
  	}
code_tokens: public static function getAccessControlPolicy ( $ bucket , $ uri = '' ) { $ rest = new S3Request ( 'GET' , $ bucket , $ uri , self :: $ endpoint ) ; $ rest -> setParameter ( 'acl' , null ) ; $ rest = $ rest -> getResponse ( ) ; if ( $ rest -> error === false && $ rest -> code !== 200 ) $ rest -> error = array ( 'code' => $ rest -> code , 'message' => 'Unexpected HTTP status' ) ; if ( $ rest -> error !== false ) { self :: __triggerError ( sprintf ( "S3::getAccessControlPolicy({$bucket}, {$uri}): [%s] %s" , $ rest -> error [ 'code' ] , $ rest -> error [ 'message' ] ) , __FILE__ , __LINE__ ) ; return false ; } $ acp = array ( ) ; if ( isset ( $ rest -> body -> Owner , $ rest -> body -> Owner -> ID , $ rest -> body -> Owner -> DisplayName ) ) $ acp [ 'owner' ] = array ( 'id' => ( string ) $ rest -> body -> Owner -> ID , 'name' => ( string ) $ rest -> body -> Owner -> DisplayName ) ; if ( isset ( $ rest -> body -> AccessControlList ) ) { $ acp [ 'acl' ] = array ( ) ; foreach ( $ rest -> body -> AccessControlList -> Grant as $ grant ) { foreach ( $ grant -> Grantee as $ grantee ) { if ( isset ( $ grantee -> ID , $ grantee -> DisplayName ) ) // CanonicalUser $ acp [ 'acl' ] [ ] = array ( 'type' => 'CanonicalUser' , 'id' => ( string ) $ grantee -> ID , 'name' => ( string ) $ grantee -> DisplayName , 'permission' => ( string ) $ grant -> Permission ) ; elseif ( isset ( $ grantee -> EmailAddress ) ) // AmazonCustomerByEmail $ acp [ 'acl' ] [ ] = array ( 'type' => 'AmazonCustomerByEmail' , 'email' => ( string ) $ grantee -> EmailAddress , 'permission' => ( string ) $ grant -> Permission ) ; elseif ( isset ( $ grantee -> URI ) ) // Group $ acp [ 'acl' ] [ ] = array ( 'type' => 'Group' , 'uri' => ( string ) $ grantee -> URI , 'permission' => ( string ) $ grant -> Permission ) ; else continue ; } } } return $ acp ; }
docstring: Get object or bucket Access Control Policy
  
  @param string $bucket Bucket name
  @param string $uri Object URI
  @return mixed | false
docstring_tokens: Get object or bucket Access Control Policy