WEBVTT

NOTE Created by CaptionSync from Automatic Sync Technologies www.automaticsync.com

00:00:01.056 --> 00:00:03.846 align:middle
Symfony has even more debugging tools.

00:00:04.976 --> 00:00:11.686 align:middle
The easiest way to get all of them is to find
your terminal and run: composer require debug --

00:00:11.846 --> 00:00:19.186 align:middle
dev Find your browser, surf back to
symfony.sh and search for "debug".

00:00:20.656 --> 00:00:28.546 align:middle
Ah, so the debug alias will actually
install a package called symfony/debug-pack.

00:00:29.436 --> 00:00:31.736 align:middle
So... what's a pack?

00:00:32.546 --> 00:00:36.756 align:middle
Click to look at the package details,
and then go to its GitHub repository.

00:00:37.746 --> 00:00:42.756 align:middle
Whoa! It's just a single file: composer.json!

00:00:43.576 --> 00:00:47.606 align:middle
Inside, it requires six other libraries!

00:00:48.466 --> 00:00:54.826 align:middle
Sometimes, you're going to want to install
several packages at once related to one feature.

00:00:55.576 --> 00:00:59.206 align:middle
To make that easy, Symfony
has a number of "packs",

00:00:59.516 --> 00:01:03.756 align:middle
and their whole purpose is
give you one easy package

00:01:03.936 --> 00:01:07.396 align:middle
that actually installs several other libraries.

00:01:08.226 --> 00:01:13.606 align:middle
In this case, composer require debug will
install Monolog - a logging library -

00:01:13.886 --> 00:01:20.156 align:middle
phpunit-bridge for testing and even the
profiler-pack that we already installed earlier.

00:01:21.366 --> 00:01:22.666 align:middle
If you go back to the terminal...

00:01:23.646 --> 00:01:28.466 align:middle
yep! It downloaded all those
libraries and configured a few recipes.

00:01:30.276 --> 00:01:31.696 align:middle
And... check this out!

00:01:32.386 --> 00:01:34.746 align:middle
Refresh! Hey!

00:01:35.056 --> 00:01:37.816 align:middle
Our Twig dump() got prettier!

00:01:38.346 --> 00:01:42.046 align:middle
The debug-pack integrated
everything together even better.

00:01:43.506 --> 00:01:45.826 align:middle
Go back to your Twig template
and remove that dump.

00:01:47.016 --> 00:01:49.086 align:middle
Then, open composer.json.

00:01:50.446 --> 00:01:55.656 align:middle
We just installed two packs: the
debug-pack and the profiler-pack.

00:01:56.126 --> 00:02:02.096 align:middle
And we now know that the debug-pack is
actually a collection of about 6 libraries.

00:02:02.746 --> 00:02:05.566 align:middle
But, packs have a disadvantage...

00:02:05.726 --> 00:02:07.226 align:middle
a "dark side".

00:02:07.946 --> 00:02:12.776 align:middle
What if you wanted to control the
version of just one of these libraries?

00:02:13.486 --> 00:02:16.826 align:middle
Or what if you wanted most of these libraries,

00:02:17.046 --> 00:02:20.886 align:middle
but you didn't want, for
example, the phpunit-bridge.

00:02:21.626 --> 00:02:29.416 align:middle
Well... right now, there's no way to do that:
all we have is this one debug-pack line.

00:02:30.216 --> 00:02:31.836 align:middle
Don't worry brave space traveler!

00:02:32.346 --> 00:02:34.526 align:middle
Just... unpack the pack!

00:02:35.476 --> 00:02:43.686 align:middle
Yep, at your terminal, run: composer
unpack debug The unpack command comes

00:02:43.686 --> 00:02:44.696 align:middle
from Symfony flex.

00:02:45.226 --> 00:02:47.156 align:middle
And... interesting!

00:02:47.556 --> 00:02:51.116 align:middle
All it says is "removing symfony/debug-pack".

00:02:51.116 --> 00:02:56.026 align:middle
But if you look at your composer.json, ah!

00:02:56.496 --> 00:03:05.346 align:middle
It did remove symfony/debug-pack, but it
replaced it with the 6 libraries from that pack!

00:03:05.896 --> 00:03:11.596 align:middle
We can now control the versions or even remove
individual libraries if we don't want them.

00:03:12.556 --> 00:03:14.906 align:middle
That is the power of packs!

