Chapters
48 Chapters
|
5:05:05
|
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!
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 with Symfony 4.3, but will work well on Symfony 4.4 or 5.
What PHP libraries does this tutorial use?
// composer.json
{
"require": {
"php": "^7.1.3",
"ext-ctype": "*",
"ext-iconv": "*",
"composer/package-versions-deprecated": "^1.11", // 1.11.99
"doctrine/annotations": "^1.0", // v1.8.0
"doctrine/doctrine-bundle": "^1.6.10", // 1.11.2
"doctrine/doctrine-migrations-bundle": "^1.3|^2.0", // v2.0.0
"doctrine/orm": "^2.5.11", // v2.6.3
"intervention/image": "^2.4", // 2.4.2
"league/flysystem-bundle": "^1.0", // 1.1.0
"phpdocumentor/reflection-docblock": "^3.0|^4.0", // 4.3.1
"sensio/framework-extra-bundle": "^5.3", // v5.3.1
"symfony/console": "4.3.*", // v4.3.2
"symfony/dotenv": "4.3.*", // v4.3.2
"symfony/flex": "^1.9", // v1.21.6
"symfony/framework-bundle": "4.3.*", // v4.3.2
"symfony/messenger": "4.3.*", // v4.3.4
"symfony/property-access": "4.3.*", // v4.3.2
"symfony/property-info": "4.3.*", // v4.3.2
"symfony/serializer": "4.3.*", // v4.3.2
"symfony/validator": "4.3.*", // v4.3.2
"symfony/webpack-encore-bundle": "^1.5", // v1.6.2
"symfony/yaml": "4.3.*" // v4.3.2
},
"require-dev": {
"easycorp/easy-log-handler": "^1.0.7", // v1.0.7
"symfony/debug-bundle": "4.3.*", // v4.3.2
"symfony/maker-bundle": "^1.0", // v1.12.0
"symfony/monolog-bundle": "^3.0", // v3.4.0
"symfony/stopwatch": "4.3.*", // v4.3.2
"symfony/twig-bundle": "4.3.*", // v4.3.2
"symfony/var-dumper": "4.3.*", // v4.3.2
"symfony/web-profiler-bundle": "4.3.*" // v4.3.2
}
}
5 Comments
Hi guys,
I wanna ask about LoggerAwareTrait. You wrote in this tutorial:
But yesterday I did manual tests for some of my project functionality and I discovered that logger setted inside MessageHandler by using LoggerAwareTrait and implementing LoggerAwareInterface is always null. So I thought it's probably something wrong with logger. So I created new one by Dependency injection in constructor and that one works correctly. What could I do wrong with LoggerAwareTrait?? I use Symfony 4.3.11.
Hey Cristóbal Rejdych
That's odd. I tested it on Symfony 4.4 and it worked fine. Can you double-check if you imported the right classes
if that's not the case, can you upgrade to Symfony 4.4? it's possible that there is a bug on the version you are
Cheers!
Hi Diego,
yeah I'm imported that classes, implement LoggerAwareInterface and use LoggerAwareTrait inside class. So if nothing else could break it down, it must be bug. For now I change it to simple DI inside constructor, but when I complete all required by project tasks I try to upgrade it to Symfony 4.4 and wrote here result.
Thanks a lot for reply.
Cheers ;)!
Interesting... One last thing I can think of is that you have to restart the Messenger Worker every time you change your App's code but I suppose you did that so I'm leaning towards a bug on Messenger
Yeah I'm restarting worker after any changes I do inside messenger. Like I wrote before I was curious of this problem and I'm upgraded Symfony to latest version 4.4 and test it again and problem with this trait still exist, so it's not bug in Symfony, but fortunately DI logger service still work properly so I don't see reason to make it big problem which must be resolved. If I in the future find cause of problem I will post info about it here ;)
"Houston: no signs of life"
Start the conversation!