Тэги:
#php8_tutorial #php_course #learn_php_the_right_way #object_oriented_php #full_php_course #php_in_2021 #advanced_php_course #php_8.1 #symfony_console #build_cli_tool_with_symfony_console #php_command_line_interface #php_cli #create_commands_in_php #cli_commandsКомментарии:
Is it also possible to add phpunit commands to our myapp command?
ОтветитьThanks for the tutorial. Do you perhaps know why I do not get any errors in my console if 'myapp.php' has errors? When I execute it, if there is any error, it does not return anything. But, if the code is correct, the script executes properly.
ОтветитьWhat do you think of the slim bridge component? ever tried it?
ОтветитьI am working in symfony projects for a few months now and only had a bit experience with laravel before that. It was a bit tough in the begining but a few weeks ago it really started kickin in and i love working with symfony so much! Every time i watch you explain something i learn so much cool stuff. Thanks a lot. I wrote a few commands this week and looking forward to watch you do it 😀
ОтветитьGreat lesson to end this section with, Gio. Fast and much, but with pausing and going back, I could follow it and find you build the complexity up well. It's quite a journey, this course you offer and it brought me to solutions I might otherwise not even have considered in any near future.
One question popped up in me... you noticed in the lesson that ConsoleRunner exists in Migration, ORM and DBAL and decided to just copy. That's alright of course, but I wondered if it would have also been possible to just use an alias and let Doctrine do the work on adding the commands too. They have different namespaces.
So I tried changing
$application->addCommands($migrationCommands($dependencyFactory));
to:
use Doctrine\Migrations\Tools\Console\ConsoleRunner as MigrationConsoleRunner;
MigrationConsoleRunner::addCommands( $application, $dependencyFactory );
And the commands still seem to work.
Perhaps you choose the other path as a demo, or you didn't want the entire class loaded for one method. But it was fun to also try this. It seemed a more quick and easy way to get all the commands of Migration.
Up to the next series. 🙂Thanks so much.
Thank you keep up the course!
ОтветитьThanks GIO for the insights.
ОтветитьThank you.
ОтветитьOk Gio. I'm done. Custom commands ✅, dbal, orm and migration commands on myapp cli ✅. Refactoring ✅. I took a while though cause I was trying to work out ways to work faster with docker. Was a long detour but I learnt a lot. Turns out that ultimately I'll have to upgrade to a system with a higher spec. But for now I'm stable and ready for the next lesson. Thanks a lot Gio.
ОтветитьReally great stuff my man!
ОтветитьHi Gio, Just watched, this is another level! I always thought cli stuff was deep programming and beyond me but here you are showing us a thing or two. I'm exited! I haven't refactored mine yet though, just watched and will certainly do. but I have a question. Why is it best for us to build a custom cli and not use the doctrine cli? Just trying to understand the importance and how it impacts on the quality of work done by a programmer. Thanks a lot Gio, you are the best I know...
ОтветитьGreat. Been anticipating. Let me delve in. Thanks Gio
ОтветитьNah, I write raw scripts at my work. For DB migrations. 😎💪
Ответить