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