Chapters
40 Chapters
|
4:39:58
|
Login to bookmark this video
-
Course Code
Subscribe to download the code!Compatible PHP versions: ^7.1.3
Subscribe to download the code!Compatible PHP versions: ^7.1.3
-
This Video
Subscribe to download the video!
Subscribe to download the video!
-
Subtitles
Subscribe to download the subtitles!
Subscribe to download the subtitles!
-
Course Script
Subscribe to download the script!
Subscribe to download the script!
14.
Flysystem: Filesystem Abstraction
Scroll down to the script below, click on any sentence (including terminal blocks) to jump to that spot in the video!
Subscribe to jump to this part in the video!
Keep on Learning!
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
This tutorial is built on Symfony 4 but works great in Symfony 5!
What PHP libraries does this tutorial use?
// composer.json
{
"require": {
"php": "^7.1.3",
"ext-iconv": "*",
"aws/aws-sdk-php": "^3.87", // 3.87.10
"composer/package-versions-deprecated": "^1.11", // 1.11.99
"doctrine/annotations": "^1.0", // 1.10.1
"doctrine/doctrine-bundle": "^1.6.10", // 1.10.2
"doctrine/doctrine-migrations-bundle": "^1.3|^2.0", // v2.0.0
"doctrine/orm": "^2.5.11", // v2.7.2
"knplabs/knp-markdown-bundle": "^1.7", // 1.7.1
"knplabs/knp-paginator-bundle": "^2.7", // v2.8.0
"knplabs/knp-time-bundle": "^1.8", // 1.9.0
"league/flysystem-aws-s3-v3": "^1.0", // 1.0.22
"league/flysystem-cached-adapter": "^1.0", // 1.0.9
"liip/imagine-bundle": "^2.1", // 2.1.0
"nexylan/slack-bundle": "^2.0,<2.2.0", // v2.1.0
"oneup/flysystem-bundle": "^3.0", // 3.0.3
"php-http/guzzle6-adapter": "^1.1", // v1.1.1
"phpdocumentor/reflection-docblock": "^3.0|^4.0", // 4.3.0
"sensio/framework-extra-bundle": "^5.1", // v5.2.4
"stof/doctrine-extensions-bundle": "^1.3", // v1.3.0
"symfony/asset": "^4.0", // v4.2.3
"symfony/console": "^4.0", // v4.2.3
"symfony/flex": "^1.9", // v1.21.6
"symfony/form": "^4.0", // v4.2.3
"symfony/framework-bundle": "^4.0", // v4.2.3
"symfony/property-access": "4.2.*", // v4.2.3
"symfony/property-info": "4.2.*", // v4.2.3
"symfony/security-bundle": "^4.0", // v4.2.3
"symfony/serializer": "4.2.*", // v4.2.3
"symfony/twig-bundle": "^4.0", // v4.2.3
"symfony/validator": "^4.0", // v4.2.3
"symfony/web-server-bundle": "^4.0", // v4.2.3
"symfony/yaml": "^4.0", // v4.2.3
"twig/extensions": "^1.5" // v1.5.4
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^3.0", // 3.1.0
"easycorp/easy-log-handler": "^1.0.2", // v1.0.7
"fzaninotto/faker": "^1.7", // v1.8.0
"symfony/debug-bundle": "^3.3|^4.0", // v4.2.3
"symfony/dotenv": "^4.0", // v4.2.3
"symfony/maker-bundle": "^1.0", // v1.11.3
"symfony/monolog-bundle": "^3.0", // v3.3.1
"symfony/phpunit-bridge": "^3.3|^4.0", // v4.2.3
"symfony/stopwatch": "4.2.*", // v4.2.3
"symfony/var-dumper": "^3.3|^4.0", // v4.2.3
"symfony/web-profiler-bundle": "4.2.*" // v4.2.3
}
}
6 Comments
Hello, with the new version, is the configuration should be:
and in my liip imagine:
But i have issue with the resolver
Source from https://github.com/thephple...
My issue was on the entity where I let the "uploads" dir in path whereas it should ne be there!
Thanks for sharing Christophe R.!
I'm trying to run this with PHP 8.1, but it looks like the cache adapter (composer require league/flysystem-cached-adapter) is locked to an older version of flysystem (~1), which isn't compatible.
Updating flysystem it seems they've changed the name of the interface class to Operator, e.g. League\Flysystem\FilesystemOperator instead of League\Flysystem\FilesystemInterface.
I'm wondering if the Symfony Filesystem can be used instead (ditto on the cache), and if anyone's updated the demo project to the latest Symfony and PHP. I find uploads very confusing, especially on s3, but with all my projects moving to a cloud-based system, it's a necessity. Ryan, any chance of an update to this terrific tutorial?
Yo Tac-Tacelosky!
Yea, unfortunately, this tutorial only installed on PHP 7 (we've got a little tooltip about it when you download the code - but it might be too subtle).
> but it looks like the cache adapter (composer require league/flysystem-cached-adapter) is locked to an older version of flysystem (~1), which isn't compatible
Correct. This adapter doesn't work with Flysystem v2... and my guess is that at least v2 is needed for php 8.1. That's also why you're seeing interface changes.
> Ryan, any chance of an update to this terrific tutorial?
We might, yes :). But it would be a few months. You can't use Symfony Filesystem, but I think Flysystem is really what you're looking for: a tool that makes working on S3 "feel" like a normal filesystem. I wouldn't be too turned-off by this code not running in PHP 8. Other than some namespace changes (and that cached adapter no longer being supported), nothing has significantly changed. Oh, but if you want, there is also a newer bundle (was made after I made this tutorial) for working with Flysystem in Symfony: https://github.com/thephple...
Cheers!
When I run
composer require one/flystem-bundle(with Symfony 4.2/May 2021), composer attempts to install flysystem bundle v4.0 but generates the following error:Your requirements could not be resolved to an installable set of packages.
Problem 1
The solution is to install the same version as Ryan (which is v3) like so:
composer require oneup/flysystem-bundle:^3.0Hope that helps someone else.
"Houston: no signs of life"
Start the conversation!