當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。