gstreamer0.10-ffmpeg
gstreamer0.10-plugins-good
packages.
Where do these Flex recipes lives? They live... in the cloud. More specifically, if you look back at https://flex.symfony.com, you can click to view the Recipe for any of the packages.
Tip
The flex.symfony.com server was shut down in favor of a new system. But you can still see a list of all of the available recipes at https://bit.ly/flex-recipes!
This goes to... interesting: a GitHub repository called symfony/recipes
.
Go to the homepage of this repository. This is the central repository for recipes, organized by the name of the package... and then each package can have different recipes for different versions. Our recipe lives in sensiolabs/security-checker/4.0
.
Every recipe has at least this manifest.json
file, which describes all of the "things" it should do. This copy-from-recipe
says that the contents of the config/
directory in the recipe should be copied into our project. This is why a config/packages/security_checker.yaml
file was added to our app.
Back in the manifest, the composer-scripts
section tells Flex to add this line to our composer.json
file... and aliases
define... well... the aliases that should map to this package.
There are a few other things that a recipe can do, but this is the basic idea.
So... all Symfony recipes live in this one repository. Hmm, actually, that's not true: all Symfony recipes lives in this repository or in another one called recipes-contrib
. There's no difference between these, except that quality control is higher on recipes merged into the main repository.
Another way you can see details about the recipes is via Composer itself. Run:
composer recipes
These are the 7 recipes that have been installed into our app. And if we run:
composer recipes sensiolabs/security-checker
We can see more details, like the URL to the recipe and files it copied into our app.
Anyways, the recipe system is going to be our best friend: allowing our app to start tiny, but grow automatically when we install new packages.
Oh, and if you decide that you want to remove a package, its recipe will be uninstalled. Check it out:
composer remove sec-checker
That - of course - will remove the package... but it also "unconfigured" the recipe. When we run:
git status
It's clean! It reverted the change in composer.json
and removed the config file.
{ | |
... lines 2 - 3 | |
"require": { | |
"php": "^7.2.5", | |
"ext-ctype": "*", | |
"ext-iconv": "*", | |
"sensio/framework-extra-bundle": "^5.5", | |
"symfony/console": "5.0.*", | |
"symfony/dotenv": "5.0.*", | |
"symfony/flex": "^1.3.1", | |
"symfony/framework-bundle": "5.0.*", | |
"symfony/yaml": "5.0.*" | |
}, | |
... lines 15 - 44 | |
"scripts": { | |
"auto-scripts": { | |
"cache:clear": "symfony-cmd", | |
"assets:install %PUBLIC_DIR%": "symfony-cmd" | |
}, | |
... lines 50 - 55 | |
}, | |
... lines 57 - 65 | |
} |
Next: let's install Twig - Symfony's templating engine - so we can create HTML templates. The Twig recipe is going to make this so easy.
Hey Maxii123,
Another good question ;) Well, I don't know the exact reason behind of this too, but I know that recipes are a bit different than composer packages, so it might be a problem. Or probably it's just a lack of functionality that has not been implemented yet. I think this is a good question to discuss on symfony/symfony repo as well.
Cheers!
// composer.json
{
"require": {
"php": "^7.3.0 || ^8.0.0",
"ext-ctype": "*",
"ext-iconv": "*",
"easycorp/easy-log-handler": "^1.0.7", // v1.0.9
"sensio/framework-extra-bundle": "^6.0", // v6.2.1
"symfony/asset": "5.0.*", // v5.0.11
"symfony/console": "5.0.*", // v5.0.11
"symfony/debug-bundle": "5.0.*", // v5.0.11
"symfony/dotenv": "5.0.*", // v5.0.11
"symfony/flex": "^1.3.1", // v1.17.5
"symfony/framework-bundle": "5.0.*", // v5.0.11
"symfony/monolog-bundle": "^3.0", // v3.5.0
"symfony/profiler-pack": "*", // v1.0.5
"symfony/routing": "5.1.*", // v5.1.11
"symfony/twig-pack": "^1.0", // v1.0.1
"symfony/var-dumper": "5.0.*", // v5.0.11
"symfony/webpack-encore-bundle": "^1.7", // v1.8.0
"symfony/yaml": "5.0.*" // v5.0.11
},
"require-dev": {
"symfony/profiler-pack": "^1.0" // v1.0.5
}
}
I'm curious as to why recipes are not stored locally in vendor/. And sure enough, turning off networking composer recipes fails.