WEBVTT

NOTE Created by CaptionSync from Automatic Sync Technologies www.automaticsync.com

00:00:01.106 --> 00:00:03.026 align:middle
Where do these Flex recipes lives?

00:00:03.666 --> 00:00:04.076 align:middle
They live...

00:00:04.586 --> 00:00:05.706 align:middle
in the cloud.

00:00:06.396 --> 00:00:10.746 align:middle
More specifically, if you look
back at https://flex.symfony.com,

00:00:11.126 --> 00:00:14.566 align:middle
you can click to view the
Recipe for any of the packages.

00:00:15.816 --> 00:00:16.686 align:middle
This goes to...

00:00:16.946 --> 00:00:22.006 align:middle
interesting: a GitHub repository
called symfony/recipes.

00:00:22.136 --> 00:00:24.506 align:middle
Go to the homepage of this repository.

00:00:24.946 --> 00:00:30.996 align:middle
This is the central repository for recipes,
organized by the name of the package...

00:00:31.366 --> 00:00:35.046 align:middle
and then each package can have
different recipes for different versions.

00:00:35.366 --> 00:00:40.216 align:middle
Our recipe lives in
sensiolabs/security-checker/4.0.

00:00:41.386 --> 00:00:45.716 align:middle
Every recipe has at least
this manifest.json file,

00:00:46.216 --> 00:00:49.326 align:middle
which describes all of the
"things" it should do.

00:00:50.186 --> 00:00:54.886 align:middle
This copy-from-recipe says that the
contents of the config/ directory

00:00:54.886 --> 00:00:57.886 align:middle
in the recipe should be copied into our project.

00:00:59.136 --> 00:01:04.496 align:middle
This is why a
config/packages/security_checker.yaml file was

00:01:04.496 --> 00:01:05.266 align:middle
added to our app.

00:01:06.526 --> 00:01:10.746 align:middle
Back in the manifest, the
composer-scripts section tells Flex

00:01:10.746 --> 00:01:14.176 align:middle
to add this line to our composer.json file...

00:01:14.666 --> 00:01:16.316 align:middle
and aliases define...

00:01:16.656 --> 00:01:20.076 align:middle
well... the aliases that
should map to this package.

00:01:20.736 --> 00:01:24.606 align:middle
There are a few other things that a
recipe can do, but this is the basic idea.

00:01:25.416 --> 00:01:29.896 align:middle
So... all Symfony recipes
live in this one repository.

00:01:30.626 --> 00:01:35.836 align:middle
Hmm, actually, that's not true: all
Symfony recipes lives in this repository

00:01:36.146 --> 00:01:40.056 align:middle
or in another one called recipes-contrib.

00:01:40.926 --> 00:01:45.466 align:middle
There's no difference between these,
except that quality control is higher

00:01:45.466 --> 00:01:48.566 align:middle
on recipes merged into the main repository.

00:01:50.696 --> 00:01:54.916 align:middle
Another way you can see details about
the recipes is via Composer itself.

00:01:55.606 --> 00:02:03.276 align:middle
Run: composer recipes These are the 7 recipes
that have been installed into our app.

00:02:04.096 --> 00:02:09.696 align:middle
And if we run: composer recipes
sensiolabs/security-checker We can see more

00:02:09.696 --> 00:02:14.486 align:middle
details, like the URL to the recipe
and files it copied into our app.

00:02:15.756 --> 00:02:22.806 align:middle
Anyways, the recipe system is going to be our
best friend: allowing our app to start tiny,

00:02:23.046 --> 00:02:26.666 align:middle
but grow automatically when
we install new packages.

00:02:27.236 --> 00:02:33.816 align:middle
Oh, and if you decide that you want to remove
a package, its recipe will be uninstalled.

00:02:34.246 --> 00:02:40.846 align:middle
Check it out: composer remove sec-checker
That - of course - will remove the package...

00:02:41.206 --> 00:02:44.336 align:middle
but it also "unconfigured" the recipe.

00:02:45.796 --> 00:02:48.536 align:middle
When we run: git status It's clean!

00:02:48.926 --> 00:02:53.106 align:middle
It reverted the change in composer.json
and removed the config file.

00:02:53.576 --> 00:03:01.076 align:middle
Next: let's install Twig - Symfony's templating
engine - so we can create HTML templates.

00:03:01.616 --> 00:03:04.876 align:middle
The Twig recipe is going to make this so easy.

