WEBVTT NOTE Created by CaptionSync from Automatic Sync Technologies www.automaticsync.com 00:00:01.136 --> 00:00:02.146 align:middle Fun fact time! 00:00:02.636 --> 00:00:05.726 align:middle When you start a brand new Symfony project, behind the scenes, 00:00:05.936 --> 00:00:12.316 align:middle what you're actually doing is cloning this repository: symfony/skeleton. 00:00:12.876 --> 00:00:18.206 align:middle Yep, your app literally starts as a single composer.json file. 00:00:18.476 --> 00:00:23.526 align:middle But as soon as Composer installs your dependencies, the app is suddenly filled 00:00:23.526 --> 00:00:26.456 align:middle with a few directories and about 15 files. 00:00:27.016 --> 00:00:30.256 align:middle All of those things are added by different recipes. 00:00:30.826 --> 00:00:36.766 align:middle So even the most "core" files - for example, public/index.php, 00:00:36.766 --> 00:00:40.956 align:middle the file that our web server executes, is added by a recipe! 00:00:40.956 --> 00:00:44.736 align:middle We pretty much never need to look inside here or do anything, 00:00:44.906 --> 00:00:48.006 align:middle even though it's critical to our app working. 00:00:49.106 --> 00:00:56.056 align:middle Another example is config/bootstrap.php: the boring, low-level file that initializes 00:00:56.216 --> 00:00:58.566 align:middle and normalizes environment variables. 00:00:59.296 --> 00:01:03.266 align:middle It's important that all Symfony projects have the same version of this file. 00:01:03.856 --> 00:01:07.616 align:middle If they didn't, some apps might work different than others... 00:01:07.896 --> 00:01:10.656 align:middle even if they have the same version of Symfony. 00:01:11.436 --> 00:01:15.236 align:middle Think of trying to write documentation for thousands of projects 00:01:15.346 --> 00:01:17.976 align:middle that all work a little bit differently. 00:01:18.296 --> 00:01:19.816 align:middle It's literally my nightmare. 00:01:20.536 --> 00:01:24.676 align:middle All of the configuration files were also originally added by recipes. 00:01:25.496 --> 00:01:31.276 align:middle For example, cache.yaml comes from the recipe for symfony/framework-bundle`. 00:01:32.096 --> 00:01:35.786 align:middle Over time, the recipes themselves tend to change. 00:01:36.546 --> 00:01:39.826 align:middle If we installed the symfony/cache component today, 00:01:40.166 --> 00:01:44.066 align:middle it might give us a slightly different cache.yaml file. 00:01:44.866 --> 00:01:47.116 align:middle There are three reasons that a recipe might change. 00:01:47.776 --> 00:01:53.256 align:middle First, someone might update a recipe just because they want to add more examples 00:01:53.596 --> 00:01:56.616 align:middle or add some documentation comments to a config file. 00:01:57.376 --> 00:01:58.256 align:middle Those changes... 00:01:58.406 --> 00:01:59.796 align:middle aren't super important. 00:02:00.736 --> 00:02:04.816 align:middle Or, second, someone might update a configuration file inside a recipe 00:02:04.856 --> 00:02:10.556 align:middle to activate a new feature that's probably from a new version of that library. 00:02:11.306 --> 00:02:13.836 align:middle These changes aren't critical to know about... 00:02:14.096 --> 00:02:18.746 align:middle but it is nice to know if a great new feature is suddenly available. 00:02:19.406 --> 00:02:25.656 align:middle We saw that a few minutes ago when the updated MonologBundle recipe told us about a cool option 00:02:25.786 --> 00:02:27.796 align:middle for filtering logs by status code. 00:02:28.766 --> 00:02:33.216 align:middle The third reason a recipe might update is because something needs to be fixed, 00:02:33.746 --> 00:02:37.916 align:middle or we decide that we want to change some significant behavior. 00:02:38.526 --> 00:02:40.576 align:middle These changes are important. 00:02:41.166 --> 00:02:47.136 align:middle Let me give you an example: during the first year after Symfony 4.0, several small 00:02:47.136 --> 00:02:52.626 align:middle but meaningful tweaks were made to the bootstrap.php file to make sure 00:02:52.626 --> 00:02:56.226 align:middle that environment variables have just the right behavior. 00:02:56.866 --> 00:03:02.766 align:middle If you started your project on Symfony 4.0 and never "updated" the bootstrap.php file, 00:03:03.196 --> 00:03:07.676 align:middle your app will be handling environment variables in a different way than other apps. 00:03:08.156 --> 00:03:14.366 align:middle That's... not great: we want our bootstrap.php file to look exactly like it should. 00:03:15.566 --> 00:03:20.096 align:middle A few minutes ago, when we did all the composer updating stuff, one of the packages 00:03:20.096 --> 00:03:27.796 align:middle that we upgraded was symfony/flex itself: we upgraded it to 1.6.0. 00:03:28.346 --> 00:03:29.436 align:middle Well guess what?! 00:03:29.786 --> 00:03:35.386 align:middle Starting in Flex 1.6.0, there are some brand new fancy, amazing, 00:03:35.386 --> 00:03:40.056 align:middle incredible commands inside Composer to help inspect & upgrade recipes. 00:03:40.056 --> 00:03:44.946 align:middle It still takes a little bit of work and care, but the process is now very possible. 00:03:45.526 --> 00:03:50.936 align:middle A big thanks to community member and friend maxhelias who really helped to get this done. 00:03:51.726 --> 00:03:52.496 align:middle Let's go check them out! 00:03:52.866 --> 00:03:59.196 align:middle Move over to your terminal and run: composer recipes Cool! 00:03:59.816 --> 00:04:06.096 align:middle This lists every recipe that we have installed and whether or not there is an update available. 00:04:06.656 --> 00:04:12.746 align:middle Heck, it will even show you if a package that's installed has a recipe that you're missing - 00:04:13.136 --> 00:04:14.776 align:middle maybe because it was added later. 00:04:15.716 --> 00:04:20.676 align:middle Because my project was originally created on Symfony 4.0, it's fairly old 00:04:20.676 --> 00:04:23.056 align:middle and a lot of recipes have updates. 00:04:23.686 --> 00:04:26.436 align:middle The recipe system is also relatively new, 00:04:26.856 --> 00:04:31.056 align:middle so I think there were more updates during the first 2 years of that system 00:04:31.276 --> 00:04:33.716 align:middle than there will be in the next two years. 00:04:34.176 --> 00:04:35.596 align:middle We've got some work to do. 00:04:36.336 --> 00:04:39.676 align:middle Of course, we could just ignore these recipe updates... 00:04:39.816 --> 00:04:45.026 align:middle but we're risking our app not working quite right or missing info about new features. 00:04:46.046 --> 00:04:48.156 align:middle Let's look at one of these more closely. 00:04:48.886 --> 00:04:51.126 align:middle How about twig/extensions. 00:04:51.936 --> 00:04:56.256 align:middle This is not a particularly important library, but it's a nice one to start with. 00:04:57.076 --> 00:05:00.926 align:middle Run: composer recipes twig/extensions to see more details. 00:05:02.086 --> 00:05:05.946 align:middle Interesting: it has a link to the installed version of the recipe. 00:05:06.916 --> 00:05:08.416 align:middle Let's go check that out in the browser. 00:05:10.426 --> 00:05:11.566 align:middle Paste and... 00:05:12.366 --> 00:05:16.666 align:middle this is what the recipe looked like the moment we installed it. 00:05:17.126 --> 00:05:21.956 align:middle We can also go grab the URL to see what the latest version of the recipe looks like. 00:05:25.626 --> 00:05:27.246 align:middle Check out the commit history. 00:05:28.516 --> 00:05:34.806 align:middle The version of the recipe we have installed has a commit hash starting with c986. 00:05:35.906 --> 00:05:38.346 align:middle Back on the history, hey! 00:05:38.656 --> 00:05:40.526 align:middle That commit is right here! 00:05:41.206 --> 00:05:47.676 align:middle So this recipe is out of date, but the only change that's been made is this one commit. 00:05:48.606 --> 00:05:49.496 align:middle Inside it... 00:05:49.906 --> 00:05:54.056 align:middle search for twig/extensions to find its changes. 00:05:54.996 --> 00:06:01.206 align:middle Ha! It's totally superficial: we changed from using tilde (~) to null... 00:06:01.606 --> 00:06:05.186 align:middle but just for clarity: those are equivalent in YAML. 00:06:05.906 --> 00:06:10.896 align:middle Yep! The update to twig/extension is not important at all. 00:06:11.386 --> 00:06:14.746 align:middle We could still update it - and I'll show you how next. 00:06:15.036 --> 00:06:16.386 align:middle But I'm going to skip it for now. 00:06:16.666 --> 00:06:17.196 align:middle Because... 00:06:17.196 --> 00:06:19.996 align:middle this is a tutorial about upgrading Symfony! 00:06:20.446 --> 00:06:24.916 align:middle So I want to focus on upgrading the recipes for everything that starts with symfony/. 00:06:25.046 --> 00:06:30.046 align:middle Let's start that process next by focusing on, surprisingly, 00:06:30.356 --> 00:06:34.896 align:middle one of the most important recipes: symfony/console.