Chapters
19 Chapters
|
2:20:12
|
Login to bookmark this video
-
Course Code
Subscribe to download the code!
Subscribe to download the code!
-
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!
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!
What PHP libraries does this tutorial use?
// composer.json
{
"require": {
"php": "^8.0.2",
"ext-ctype": "*",
"ext-iconv": "*",
"babdev/pagerfanta-bundle": "^3.6", // v3.6.1
"composer/package-versions-deprecated": "^1.11", // 1.11.99.5
"doctrine/annotations": "^1.13", // 1.13.2
"doctrine/dbal": "^3.3", // 3.3.5
"doctrine/doctrine-bundle": "^2.0", // 2.6.2
"doctrine/doctrine-migrations-bundle": "^3.2", // 3.2.2
"doctrine/orm": "^2.0", // 2.11.2
"knplabs/knp-markdown-bundle": "^1.8", // 1.10.0
"knplabs/knp-time-bundle": "^1.18", // v1.18.0
"pagerfanta/doctrine-orm-adapter": "^3.6", // v3.6.1
"pagerfanta/twig": "^3.6", // v3.6.1
"sensio/framework-extra-bundle": "^6.0", // v6.2.6
"sentry/sentry-symfony": "^4.0", // 4.2.8
"stof/doctrine-extensions-bundle": "^1.5", // v1.7.0
"symfony/asset": "6.0.*", // v6.0.7
"symfony/console": "6.0.*", // v6.0.7
"symfony/dotenv": "6.0.*", // v6.0.5
"symfony/flex": "^2.1", // v2.1.7
"symfony/form": "6.0.*", // v6.0.7
"symfony/framework-bundle": "6.0.*", // v6.0.7
"symfony/mailer": "6.0.*", // v6.0.5
"symfony/monolog-bundle": "^3.0", // v3.7.1
"symfony/property-access": "6.0.*", // v6.0.7
"symfony/property-info": "6.0.*", // v6.0.7
"symfony/proxy-manager-bridge": "6.0.*", // v6.0.6
"symfony/routing": "6.0.*", // v6.0.5
"symfony/runtime": "6.0.*", // v6.0.7
"symfony/security-bundle": "6.0.*", // v6.0.5
"symfony/serializer": "6.0.*", // v6.0.7
"symfony/stopwatch": "6.0.*", // v6.0.5
"symfony/twig-bundle": "6.0.*", // v6.0.3
"symfony/ux-chartjs": "^2.0", // v2.1.0
"symfony/validator": "6.0.*", // v6.0.7
"symfony/webpack-encore-bundle": "^1.7", // v1.14.0
"symfony/yaml": "6.0.*", // v6.0.3
"symfonycasts/verify-email-bundle": "^1.7", // v1.10.0
"twig/extra-bundle": "^2.12|^3.0", // v3.3.8
"twig/string-extra": "^3.3", // v3.3.5
"twig/twig": "^2.12|^3.0" // v3.3.10
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^3.4", // 3.4.1
"phpunit/phpunit": "^9.5", // 9.5.20
"rector/rector": "^0.12.17", // 0.12.20
"symfony/debug-bundle": "6.0.*", // v6.0.3
"symfony/maker-bundle": "^1.15", // v1.38.0
"symfony/var-dumper": "6.0.*", // v6.0.6
"symfony/web-profiler-bundle": "6.0.*", // v6.0.6
"zenstruck/foundry": "^1.16" // v1.18.0
}
}
20 Comments
Hello, Instead of the changelog I get :
I found this issue that seems to be related : https://github.com/symfony/flex/issues/974
Updating
vendor/symfony/flex/src/GithubApi.php:131like so (concat+is:pull-requestto the url) gave me a changelog :Hey @shmt!
Then that issue looks legit! Since you found the fix, would you be willing to open a pull request for it on symfony/flex? If you send the link here, I can review and support it. I'm not sure why I've never hit this before, but it'd be great to fix it!
Cheers!
After this part of course or previous i have get a list of warinig like this:
warning: in the working copy of 'src/Repository/CommentRepository.php', LF will be replaced by CRLF the next time Git touches itcan you tell me what to do with that? :)
Hi
Yeah, that sometimes happens when you are working on windows. The best solution is configuring your editor to use LF as line endings. In PHPStorm you can do it in the bottom right corner.
Cheers
Hi
I'm now going through the tutorial again using my own Symfony 5 project but when updating the symfony/frameworkbundle recipe, my code is deleted in favour of the new code. I'm not getting the conflict (ours/theirs)
Am I missing something?
Thank you Steve
Hey Steve,
Did you notice any warnings/errors in the console when was doing that upgrade? Well, it might be so that your symfony.lock file was in not-perfect state. It happens sometimes, but that's to the "git diff" you should be able to revert your original configuration manually.
I hope this helps!
Cheers!
Thank you Victor. There were no errors in the console. I did start to get conflicts later on in some areas though. I pulled the code that was removed from a copy of the project so nothing has been lost.
Thank you
Hey Steve,
Awesome, glad to hear you nailed it. Yeah, it might be some edge cases probably, not sure if those are bugs or no. If you noticed a weird behaviour that looks like a bug and you have steps how to reproduced. it - feel free to report about it in Symfony.
Cheers!
Hi
After running "composer require symfony/runtime" I get the following error when trying to view the site.
Cannot autowire service "App\Controller\QuestionController": argument "$isDebug" of method "__construct()" is type-hinted "bool", you should configure its value explicitly.
Have I missed something?
Thank you
Steve
Hey Steve,
Did you download the course code and started from the start/ directory there? It sounds like you're missing some code in your project, most probably something that were added in previous tutorials. So, I'd recommend you to follow the tutorial this way.
But what about the actual error, make sure you have this code in your config/services.yaml
If you have this - the autowiring should work. But also, please, make sure you typehinted that argument as "bool $isDebug" in the __construct(). And don't forget to clear the cache just in case to rule out the cache problem :)
Cheers!
i had, beside others, the same error. adding
to servcices.yaml fixed the problem.
yes, i used the start folder from the zip.
Hey Ek24,
Thanks for confirming this configuration helped!
Cheers!
HI Victor
I did download the course code yes and have since (in the last few mins) sussed out a couple of things. I crossed referenced the "finish" code making a few tweaks (mainly the one you have suggested) and also found that PhpStorm was using php7.4. Changing this has now got me in the right place.
Thank you so much for replying
Steve
Ah, I thought you get the error in your browser :) Yes, PhpStorm also have runtime checks that are based on the PHP version you set in config, good catch!
I'm glad you got it working ;)
Cheers!
I don't know if it's only me, but this course is already hard to follow. After the recipes:update I've got only this.
`
`
Hi,
I had the same, really confusing result. You probably also have new .git -folder in your current directory, but with only objects subdir in it?
After digging deeper what happens it seems that recipes:update does not work properly when your symfony project is in a subfolder of your git project.
(Git diff in RecipePatcher assumes you are at the root of the git project, and the same with paths to .git -folders when generating and adding the blobs.)
I think I know already how this could be fixed. But as a quick fix to get further with the course, you can try working on a git repo where you are at the root folder.
Best Regards,
Mikko
Hey Mikko,
Oh, it might be so... I personally init Git repo for all my projects in the root dir of the Symfony project, that's why I probably have never noticed it myself. Thanks for sharing this tip! Well, I'm not sure if this behaviour would be considered as a bug, but I think it's worth to be reported upstream if it has not been reported yet.
Cheers!
Hey Julien,
This does not sound like a desired behaviour... seems something went wrong, and probably the command output has more context. Btw, what command did you execute? Well, you may want to "reset" the recipe, I suppose you're talking about symfony/framework-bundle one? You can do it with
$ composer recipe:install symfony/framework-bundle --force --reset
It will force install the latest recipe overwriting the existent data, but then with "git diff" you may revert some good changes you want to keep.
I hope this helps!
Cheers!
Hum, I did reset the head and all the files and ran
$ composer recipes:update
chose symfony/framework-bundle and got the same 4 file updates only.
Then, I did a reset again to have a clean branch and ran
$ composer recipe:install symfony/framework-bundle --force --reset
which gave something closer to the expected result
You can check my setup if you want to: https://github.com/jbonnier...
Just run
$ make local-config
$ docker compose up -d
Nginx might crash if you don't have an SSL certificate in a certain path, but you shouldn't need a web server for that.
Also all my composer commands are ran in a container with
$ docker compose exec php-cli composer ...
Hey Julien,
Yeah, not sure what happened, but "recipe:install --force --reset" should do the trick because it literally just re-install the latest recipe from scratch. A trick I use sometimes if something went wrong with "recipe:update" command.
Cheers!
"Houston: no signs of life"
Start the conversation!