当前位置: 首页>>代码示例>>PHP>>正文


PHP S3Client::getObjectAcl方法代码示例

本文整理汇总了PHP中Aws\S3\S3Client::getObjectAcl方法的典型用法代码示例。如果您正苦于以下问题:PHP S3Client::getObjectAcl方法的具体用法?PHP S3Client::getObjectAcl怎么用?PHP S3Client::getObjectAcl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Aws\S3\S3Client的用法示例。


在下文中一共展示了S3Client::getObjectAcl方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getObjectAcl

 /**
  * getObjectAcl
  *
  * @param string $key
  * @param string $versionId
  *
  * @return \Guzzle\Service\Resource\Model
  */
 public function getObjectAcl($key, $versionId = '')
 {
     $params = ['Bucket' => $this->name, 'Key' => $key];
     if ($versionId) {
         $params['VersionId'] = $versionId;
     }
     return $this->client->getObjectAcl($params);
 }
开发者ID:m6web,项目名称:aws-bundle,代码行数:16,代码来源:Bucket.php

示例2: getVisibility

 /**
  * Get the visibility of a file
  *
  * @param   string  $path
  * @return  array   file metadata
  */
 public function getVisibility($path)
 {
     $options = $this->getOptions($path);
     $result = $this->client->getObjectAcl($options)->getAll();
     foreach ($result['Grants'] as $grant) {
         if (isset($grant['Grantee']['URI']) && $grant['Grantee']['URI'] === Group::ALL_USERS && $grant['Permission'] === Permission::READ) {
             return array('visibility' => AdapterInterface::VISIBILITY_PUBLIC);
         }
     }
     return array('visibility' => AdapterInterface::VISIBILITY_PRIVATE);
 }
开发者ID:luoshulin,项目名称:falcon,代码行数:17,代码来源:AwsS3.php

示例3: _filePutContents

 /**
  * Write a string to a file
  *
  * @param  string  $path     file path
  * @param  string  $content  new file content
  * @return bool
  **/
 protected function _filePutContents($path, $content)
 {
     $oldSettings = $this->getFile($path);
     $settings = array("Bucket" => $this->bucket, "Key" => $this->pathToKey($path), "ACL" => $this->options['acl'], "Body" => $content);
     if ($oldSettings) {
         $settings['Metadata'] = $oldSettings['Metadata'];
         $settings['ContentType'] = $oldSettings['ContentType'];
         $settings['ACP'] = Aws\S3\Model\Acp::fromArray($this->s3->getObjectAcl(array('Bucket' => $this->bucket, 'Key' => $this->pathToKey($path)))->toArray());
         unset($settings['ACL']);
     }
     return $this->s3->putObject($settings);
 }
开发者ID:nguyentuansieu,项目名称:BioMedia,代码行数:19,代码来源:elFinderVolumeS3.class.php

示例4: testGetObjectAcl

 /**
  * @depends testPutAndListObjects
  */
 public function testGetObjectAcl()
 {
     self::log("Getting the object's ACL");
     $model = $this->client->getObjectAcl(array('Bucket' => $this->bucket, 'Key' => self::TEST_KEY));
     $data = array();
     foreach (Acp::fromArray($model->toArray()) as $grant) {
         $grantee = $grant->getGrantee();
         $data[$grantee->getGroupUri()] = array($grantee->getType(), $grant->getPermission());
     }
     $this->assertEquals(2, count($data));
     $this->assertArrayHasKey('http://acs.amazonaws.com/groups/global/AllUsers', $data);
     $this->assertArrayHasKey('http://acs.amazonaws.com/groups/global/AuthenticatedUsers', $data);
     $this->assertEquals(array('Group', 'READ_ACP'), $data['http://acs.amazonaws.com/groups/global/AllUsers']);
     $this->assertEquals(array('Group', 'READ'), $data['http://acs.amazonaws.com/groups/global/AuthenticatedUsers']);
 }
开发者ID:myrichhub,项目名称:mssapi_php,代码行数:18,代码来源:IntegrationTest.php

示例5: getObjectAcl

 /**
  * Returns the access control list (ACL) of an object.
  *
  * @param $bucket
  * @param $key
  *
  * @return mixed
  */
 public function getObjectAcl($bucket, $key)
 {
     $params = ['Bucket' => $bucket, 'Key' => $key];
     return $this->instance->getObjectAcl($params);
 }
开发者ID:Webiny,项目名称:Framework,代码行数:13,代码来源:S3.php


注:本文中的Aws\S3\S3Client::getObjectAcl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。