-
-
Save rossriley/911b849a14717c3563d8 to your computer and use it in GitHub Desktop.
<?php | |
use Aws\S3\S3Client; | |
use League\Flysystem\Filesystem; | |
use League\Flysystem\Adapter\AwsS3 as Adapter; | |
$client = S3Client::factory(array( | |
'key' => '[your key]', | |
'secret' => '[your secret]', | |
'region' => '[aws-region]' | |
)); | |
$adapter = new Adapter($client, 'bucket-name', 'optional-prefix'); | |
$filesystem = new Filesystem($adapter); | |
// Then with Bolt App | |
$app['filesystem']->mountFilesystem('s3fs', $filesystem); |
Hello @aberrabaa.
I do not know if the code would work in such an old version. We are already in version 3.6.9, and the 3.0.0 was released there in 2016, already with S3 support.
I suggest taking the time to study the migration of your code.
You're completely right @romulo1984 and i propone the migration, but they don't accept to make it on summer cause of roadmap. This project will be plan on several month and meanwhile i have to enable managing filesystem with S3, no choice.
I am on php5.6, Bolt 2.05, and i tryed to create an extension as you propone above.
When you tested this way, did it work with the extension ?
I understand. My tests with that code there were in May 2017, so I really do not remember. But I believe it will not be so difficult. Just create this extension, register and see if everything is going as expected.
Hello,
I use an old version of BOLT (v2.0.5).
@romulo1984 : Does your comment above would work for this version, i need to implement an S3FileSystem and i have to be sure that an extension would be ok for my version.
Thanks a lot
Aymen