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


PHP S3Client::putBucketLifecycleConfiguration方法代码示例

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


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

示例1: fopen

$result = $s3->putObject(['ACL' => 'public-read', 'Bucket' => $bucket, 'Key' => "Hello" . $uploadfile, 'ContentType' => $_FILES['userfile']['tmp_name'], 'Body' => fopen($uploadfile, 'r+')]);
$url = $result['ObjectURL'];
echo $url;
$result = $s3->getObject(array('Bucket' => $bucket, 'Key' => "Hello" . $uploadfile, 'ContentType' => $_FILES['userfile']['tmp_name'], 'SaveAs' => '/tmp/originalimage.jpg'));
$image = new Imagick(glob('/tmp/originalimage.jpg'));
$image->oilPaintImage(2);
//Oilpaint image
$image->setImageFormat("jpg");
$image->writeImages('/tmp/modifiedimage.jpg', true);
$modifiedbucket = uniqid("modified-image-", false);
$result = $s3->createBucket(['ACL' => 'public-read', 'Bucket' => $modifiedbucket]);
$resultrendered = $s3->putObject(['ACL' => 'public-read', 'Bucket' => $modifiedbucket, 'Key' => "Hello" . $uploadfile, 'SourceFile' => "/tmp/modifiedimage.jpg", 'ContentType' => $_FILES['userfile']['tmp_name'], 'Body' => fopen("/tmp/modifiedimage.jpg", 'r+')]);
unlink('/tmp/modifiedimage.jpg');
$finishedurl = $resultrendered['ObjectURL'];
echo $finishedurl;
$expiration = $s3->putBucketLifecycleConfiguration(['Bucket' => $bucket, 'LifecycleConfiguration' => ['Rules' => [['Expiration' => ['Date' => '2015-12-25'], 'Prefix' => ' ', 'Status' => 'Enabled']]]]);
$expiration = $s3->putBucketLifecycleConfiguration(['Bucket' => $modifiedbucket, 'LifecycleConfiguration' => ['Rules' => [['Expiration' => ['Date' => '2015-12-25'], 'Prefix' => ' ', 'Status' => 'Enabled']]]]);
$rds = new Aws\Rds\RdsClient(['version' => 'latest', 'region' => 'us-east-1']);
$result = $rds->describeDBInstances(['DBInstanceIdentifier' => 'mp1-db']);
$endpoint = $result['DBInstances'][0]['Endpoint']['Address'];
print "============\n" . $endpoint . "================";
print_r($result);
# Database connection
$link = mysqli_connect($endpoint, "controller", "letmein888", "customerrecords", 3306) or die("Error " . mysqli_error($link));
# Check database connection
if (mysqli_connect_errno()) {
    printf("Connect failed: %s\n", mysqli_connect_error());
    exit;
}
echo "Connection to database correct ";
# Inserting data int the database
开发者ID:evercoolarshad,项目名称:ITMO544_Application_Setup,代码行数:31,代码来源:result.php


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