所以AWS php sdk 2.x库最近推出了,我已经从火鸡日开始投入1.5倍升级.我的第一个是升级我的S3备份类.我很快就遇到了一个错误:
Fatal error: Class 'EntityBody' not found in /usr/share/php/....my file here
Run Code Online (Sandbox Code Playgroud)
尝试将压缩文件上载到S3存储桶时.我写了一个类来抽象写一点,以允许多区域备份,所以下面的代码引用$ this就是这样.
$response1 = $s3->create_object(
$this->bucket_standard,
$this->filename,
array(
'fileUpload' => $this->filename,
'encryption' => 'AES256',
//'acl' => AmazonS3::ACL_PRIVATE,
'contentType' => 'text/plain',
'storage' => AmazonS3::STORAGE_REDUCED,
'headers' => array( // raw headers
'Cache-Control' => 'max-age',
//'Content-Encoding' => 'gzip',
'Content-Language' => 'en-US'
//'Expires' => 'Thu, 01 Nov 2012 16:00:00 GMT'
),
'meta' => array(
'param1' => $this->backupDateTime->format('Y-m-d H:i:s'), // put some info on the file in meta tags
'param2' => …Run Code Online (Sandbox Code Playgroud)