HI, I have been having a lovely evening with the new AWS version 3. I have code for AWS directly and League/AWS. I had problems installing 5.1 with previous version of League. So I took it out and it worked. Updated AWS 3.0 and my AWS Non-League code to upload files broke. So I made some api changes and had to add a new environment variable. If you have Zend Opcache turned on, it writes files to a PHP temp file. Got permission issues. So I set the new env var in .env to point to the storage dir Laravel uses.
\Route::get('lissa', function () {
print 'HHHHHHHHHHHHHH';
$s3 = \AWS::createClient('s3');
//$s3 = AWS::get('s3');
$result = $s3->putObject(array ('Bucket' => 'jimmck-holmdel', 'Key' => 'melissa.txt', 'Body' => 'Hi!!!!!',));
echo $result['Expiration'] . "\n";
echo $result['ServerSideEncryption'] . "\n";
echo $result['ETag'] . "\n";
echo $result['VersionId'] . "\n";
echo $result['RequestId'] . "\n";
// Get the URL the object can be downloaded from
echo $result['ObjectURL'] . "\n";
});
The comment line is the change for native AWS SDK call.
The .env setting is
AWS_PHP_CACHE_DIR=/Users/jimm/GitHub/laravel5/storage/aws
Saw your post and added league back to my composer.json and didm an update. Got version 1.02
My league code ran fine with update. I looked at line 77 in AWSClient and its part of a giant comment. Usually in the past arg errors in the SDK are either creds or service settings like 's3' ... Do, you have a stack trace. Like I said my creds for the league are in filesystem.php.
my working league code is ''' \Route::get('files', function () { // Get a remote list of files. $disk = \Storage::disk('s3'); $files = $disk->allFiles(); print ""; foreach ($files as $file) { $modified = date(DATE_RFC2822, $disk->lastModified($file)); $size = $disk->size($file); $type = $disk->mimeType($file); print "
and the output is as expected
backups/20150509021034.zip : Sat, 09 May 2015 02:10:36 +0000 (232 Bytes) : binary/octet-stream backups/20150509021212.zip : Sat, 09 May 2015 02:12:14 +0000 (232 Bytes) : binary/octet-stream data.txt : Fri, 27 Mar 2015 04:05:10 +0000 (6 Bytes) : binary/octet-stream melissa.txt : Tue, 16 Jun 2015 06:04:08 +0000 (7 Bytes) : application/octet-stream