Symfony Flex & Aliases

It's time to demystify something incredible: tractor beams. Well actually, we haven't figured those out yet... so let's demystify something else, something that's already been happening behind the scenes. First commit everything, with a nice message:

Tip

Wait! Run git init first before git add .: Symfony no longer creates a Git repo automatically for you :)

git init
git add .
git commit -m "making so much good progress"

Installing the Security Checker

Let's install a new feature called the Symfony Security Checker. This is a great tool.... but... full disclosure: we're mostly installing it to show of the recipe system. Ooooo. Run:

git status

Ok, there are no changes. Now run:

composer require sec-checker

Tip

This package will only be used while developing. So, it would be even better to run composer require sec-checker --dev.

Hello Symfony Flex

Once again, sec-checker should not be a valid package name! So what's going on? Move over and open composer.json:

64 lines composer.json
{
... lines 2 - 3
"require": {
... lines 5 - 8
"symfony/flex": "^1.0",
... lines 10 - 13
},
... lines 15 - 62
}

Our project began with just a few dependencies. One of them was symfony/flex: this is super important. Flex is a Composer plugin with two superpowers.

Flex Aliases

The first superpower is the alias system. Find your browser and go to symfony.sh.

This is the Symfony "recipe" server: we'll talk about what that means next. Search for "security". Ah, here's a package called sensiolabs/security-checker. And below, it has aliases: sec-check, sec-checker, security-check and more.

Thanks to Flex, we can say composer require sec-checker, or any of these aliases, and it will translate that into the real package name. Yep, it's just a shortcut system. But the result is really cool. Need a logger? composer require logger. Need to send emails? composer require mailer. Need a tractor beam? composer require, wait, no, we can't help with that one.

Back in composer.json, yep! Composer actually added sensiolabs/security-checker:

64 lines composer.json
{
... lines 2 - 14
"require-dev": {
"sensiolabs/security-checker": "^4.1",
... line 17
},
... lines 19 - 62
}

That's the first superpower of Flex.

Flex Recipes

The second superpower is even better: recipes. Mmmm. Go back to your terminal and... yes! It did install and, check this out: "Symfony operations: 1 recipe". Then, "Configuring sensiolabs/security-checker".

What does that mean? Run:

git status

Woh! We expected composer.json and composer.lock to be updated. But there are also changes to a symfony.lock file and we suddenly have a brand new config file!

First, symfony.lock: this file is managed by Flex. It keeps track of which recipes have been installed. Basically... commit it to git, but don't worry about it.

The second file is config/packages/dev/security_checker.yaml:

services:
SensioLabs\Security\SecurityChecker:
public: false
SensioLabs\Security\Command\SecurityCheckerCommand:
arguments: ['@SensioLabs\Security\SecurityChecker']
tags:
- { name: console.command }

This was added by the recipe and, cool! It adds a new bin/console command to our app! Don't worry about the code itself: you'll understand and be writing code like this soon enough!

The point is this: thanks to this file, we can now run:

php bin/console security:check

Cool! This is the recipe system in action! Whenever you install a package, Flex will execute the recipe for that package, if there is one. Recipes can add configuration files, create directories, or even modify files like .gitignore so that the library instantly works without any extra setup. I love Flex.

By the way, the purpose of the security checker is that it checks to see if there are any known vulnerabilities for packages used in our project. Right now, we're good!

But the recipe made one other change. Run:

git diff composer.json

Of course, composer require added the package. But the recipe added a new script!

64 lines composer.json
{
... lines 2 - 40
"scripts": {
"auto-scripts": {
... lines 43 - 44
"security-checker security:check": "script"
},
... lines 47 - 52
},
... lines 54 - 62
}

Thanks to that, whenever we run:

composer install

when it finishes, it runs the security checker automatically. So cool!

Oh, and I won't show it right now, but Flex is even smart enough to uninstall the recipes when you remove a package. That makes testing out new packages fast and easy.

The Recipes Repository

So you might be wondering... where do these recipes live? Great question! They live... in the cloud. I mean, they live on GitHub. On symfony.sh, click "Recipe" next to the Security checker. Ah, it takes us to the symfony/recipes repository. Here, you can see what files will be added and a few other changes described in manifest.json.

All recipes either live in this repository, or another one called symfony/recipes-contrib. There's no important difference between the two repositories: but the official recipes are watched more closely for quality.

Next! Let's put the recipe system to work by installing Twig so we can create proper templates.

Leave a comment!

  • 2018-10-15 Victor Bocharsky

    Hey Ivan,

    Good news! I'm glad it was helpful for you. And I bet you'll love Ansible & Ansistrano ;)

    Cheers!

  • 2018-10-14 Ivan Puntiy

    Thanks.
    And since I've now discovered Ansible and Ansistrano, I think I'm going to switch to them from my homebrewed scripts, after finishing their tutorials.

  • 2018-10-12 Victor Bocharsky

    Hey Ivan,

    I think if you want to check for security vulnerabilities on production - then you need explicitly install this checker for both dev / prod environments. Otherwise, you can install Composer dev dependencies first, let the command checks for security vulnerabilities, and then install Composer deps again but without dev ones and with --no-scripts as you said if you want to keep this command in composer.json.

    Cheers!

  • 2018-10-11 Ivan Puntiy

    So how should I deploy it now then?
    For previous projects (without Symfony) this command worked well in automatization:

    composer install -noq --no-dev --no-progress


    So now it's either to move sec-checker into require array, or use --no-scripts and call each script separately?

  • 2018-10-11 Diego Aguiar

    Hey Ivan Puntiy

    Yeah, it won't find the command because that bundle is missing from the production project.
    Anyway, you should not need to run it on production,

    Cheers!

  • 2018-10-11 Ivan Puntiy

    Just something I found out now:
    If installing sec-checker with --dev option, it'll KO when you deploy in prod environment:

    Executing script security-checker security:check [KO]
    [KO]
    Script security-checker security:check returned with error code 127
    !! sh: 1: security-checker: not found
    !!
  • 2018-09-17 weaverryan

    Hey Виктория Барышникова!

    Good thinking running the command directly to see what the problem is! Even better idea to run the -vvv!

    But, is this the only output you see? You don't see any other error on the screen? It just exits immediately with only that line? Is there a stacktrace also?

    It seems like there is some issue - as several people have reported things. I would love to be able to debug it :).

    Cheers!

  • 2018-09-15 Виктория Барышникова

    I have the same problem

    C:\Server\data\htdocs\myproject2>php ./bin/console security:check -vvv

    An error occurred: .

    2018-09-15T06:49:41+00:00 [debug] Command "security:check -vvv" exited with code "1"

  • 2018-09-10 Diego Aguiar

    Uhmm, that's weird... Have you tried re-installing the security-checker dependency?

    Please run only that command php ./bin/console security:check -vvv using the same flag to see the logs

  • 2018-09-10 Алексей Скоробогатов

    C:\OSPanel\domains\symfony.local>composer require sec-checker -vvv
    Reading ./composer.json
    Loading config file ./composer.json
    Checked CA file C:\OSPanel\modules\php\PHP-7.2-x64\cacert.pem: valid
    Executing command (C:\OSPanel\domains\symfony.local): git branch --no-color --no-abbrev -v
    Reading C:/Users//AppData/Roaming/Composer/composer.json
    Loading config file C:/Users//AppData/Roaming/Composer/composer.json
    Reading C:\OSPanel\domains\symfony.local/vendor/composer/installed.json
    Reading C:/Users//AppData/Roaming/Composer/vendor/composer/installed.json
    Loading plugin Symfony\Flex\Flex
    Downloading https://repo.packagist.org/...
    Writing C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... into cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Downloading http://repo.packagist.org/p...
    Downloading http://repo.packagist.org/p...
    Writing C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... into cache
    Writing C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... into cache
    Running 1.7.2 (2018-08-16 16:57:12) with PHP 7.2.0 on Windows NT / 10.0
    Reading C:/Users//AppData/Local/Composer/repo/https---flex.symfony.com/al... from cache
    Downloading https://flex.symfony.com/al...
    Writing C:/Users//AppData/Local/Composer/repo/https---flex.symfony.com/al... into cache
    Downloading https://repo.packagist.org/...
    Writing C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... into cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Using version ^4.1 for sensiolabs/security-checker
    ./composer.json has been updated
    Reading ./composer.json
    Loading config file ./composer.json
    Executing command (C:\OSPanel\domains\symfony.local): git branch --no-color --no-abbrev -v
    Reading C:/Users//AppData/Roaming/Composer/composer.json
    Loading config file C:/Users//AppData/Roaming/Composer/composer.json
    Reading C:\OSPanel\domains\symfony.local/vendor/composer/installed.json
    Reading C:/Users//AppData/Roaming/Composer/vendor/composer/installed.json
    Loading plugin Symfony\Flex\Flex_composer_tmp0
    Reading ./composer.lock
    Loading composer repositories with package information
    Downloading https://repo.packagist.org/...
    Writing C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... into cache
    Updating dependencies (including require-dev)
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Restricting packages listed in "symfony/symfony" to "4.1.*"
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/... from cache
    Resolving dependencies through SAT
    Looking at all rules.

    Dependency resolution completed in 0.010 seconds
    Analyzed 1766 packages to resolve dependencies
    Analyzed 3124 rules to resolve dependencies
    Nothing to install or update
    Resolving dependencies through SAT
    Looking at all rules.

    Dependency resolution completed in 0.001 seconds
    Reading C:\OSPanel\domains\symfony.local/vendor/composer/installed.json
    Generating autoload files
    > post-update-cmd: @auto-scripts
    Executing script cache:clear
    Executed script cache:clear [OK]
    Executing script assets:install public
    Executed script assets:install %PUBLIC_DIR% [OK]
    Executing script security-checker security:check
    Executed script security-checker security:check [KO]
    [KO]
    Script security-checker security:check returned with error code 1
    !!
    !! An error occurred: .
    !!
    !!
    Script @auto-scripts was called via post-update-cmd

  • 2018-09-09 Алексей Скоробогатов

    symfony 4.1


    C:\OSPanel\domains\symfony.local>composer require sec-checker --dev -vvv
    Reading ./composer.json
    Loading config file ./composer.json
    Checked CA file C:\OSPanel\modules\php\PHP-7.2\cacert.pem: valid
    Executing command (C:\OSPanel\domains\symfony.local): git branch --no-color --no-abbrev -v
    Executing command (C:\OSPanel\domains\symfony.local): git describe --exact-match --tags
    Executing command (C:\OSPanel\domains\symfony.local): git log --pretty="%H" -n1 HEAD
    Executing command (C:\OSPanel\domains\symfony.local): hg branch
    Executing command (C:\OSPanel\domains\symfony.local): fossil branch list
    Executing command (C:\OSPanel\domains\symfony.local): fossil tag list
    Executing command (C:\OSPanel\domains\symfony.local): svn info --xml
    Reading C:/Users//AppData/Roaming/Composer/composer.json
    Loading config file C:/Users//AppData/Roaming/Composer/composer.json
    Reading C:\OSPanel\domains\symfony.local/vendor/composer/installed.json
    Reading C:/Users//AppData/Roaming/Composer/vendor/composer/installed.json
    Loading plugin Symfony\Flex\Flex
    Downloading https://repo.packagist.org/packages.json
    Writing C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/packages.json into cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/p-provider-archived.json from cache
    Downloading http://repo.packagist.org/p/provider-2013%245ec721cd3e94e322ef625fb2976bcab7e49a32f18c033439f526f895e29bbc31.json
    Downloading http://repo.packagist.org/p/provider-2014%240f5e4af7ba5eb5b683d6f252e60be43a1ab5482b858644248a5e4efdf5f95145.json
    Downloading http://repo.packagist.org/p/provider-2015%24085df70867fe11c42b9b5d838e35438daf05f08a02a82bce7daea4d7446c3faa.json
    Downloading http://repo.packagist.org/p/provider-2016%24fb79a2d3825014877088b8b4807ab2c2eda48c7e78638434ed31e13f31882a6d.json
    Downloading http://repo.packagist.org/p/provider-2017%24ca33e0f92471c9b2116070128c54700459e29335198b26fa242e417bd7e7afae.json
    Downloading http://repo.packagist.org/p/provider-2017-10%24f8e1ba98f5e369d771cb2ee61d2b4b2c6c9777186dda4f217db7673c16c2d20c.json
    Downloading http://repo.packagist.org/p/provider-2018-01%2451f61200b569b3d816abd6d078f9d1b5f69bed39bffb2cfb410ea99b1005b0a1.json
    Downloading http://repo.packagist.org/p/provider-2018-04%2437c5683ca1877fac9a53b608ef1ffa84a7f9b100af8405d953e73d25fcd6ad89.json
    Downloading http://repo.packagist.org/p/provider-2018-07%24076ed230b51387e65edc534d116f6d9c1dbfde0c7034c8b656a3c407c2e580c4.json
    Downloading http://repo.packagist.org/p/provider-latest%247cc83d6461f3671332869a90066fde98894ce7ae5afe2a89dd81e2b95c424f15.json
    Writing C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/p-provider-latest.json into cache
    Writing C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/p-provider-2018-07.json into cache
    Writing C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/p-provider-2018-04.json into cache
    Writing C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/p-provider-2018-01.json into cache
    Writing C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/p-provider-2017-10.json into cache
    Writing C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/p-provider-2017.json into cache
    Writing C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/p-provider-2016.json into cache
    Writing C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/p-provider-2015.json into cache
    Writing C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/p-provider-2014.json into cache
    Writing C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/p-provider-2013.json into cache
    Running 1.7.2 (2018-08-16 16:57:12) with PHP 7.2.0 on Windows NT / 10.0
    Reading C:/Users//AppData/Local/Composer/repo/https---flex.symfony.com/aliases.json from cache
    Downloading https://flex.symfony.com/aliases.json
    Writing C:/Users//AppData/Local/Composer/repo/https---flex.symfony.com/aliases.json into cache
    Downloading https://repo.packagist.org/packages.json
    Writing C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/packages.json into cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/p-provider-2013.json from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/p-provider-2014.json from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/p-provider-2015.json from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/p-provider-2016.json from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/p-provider-2017.json from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/p-provider-2017-10.json from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/p-provider-2018-01.json from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/p-provider-2018-04.json from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/p-provider-2018-07.json from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/p-provider-archived.json from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/p-provider-latest.json from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/provider-sensiolabs$security-checker.json from cache
    Using version ^4.1 for sensiolabs/security-checker
    ./composer.json has been updated
    Reading ./composer.json
    Loading config file ./composer.json
    Executing command (C:\OSPanel\domains\symfony.local): git branch --no-color --no-abbrev -v
    Executing command (C:\OSPanel\domains\symfony.local): git describe --exact-match --tags
    Executing command (C:\OSPanel\domains\symfony.local): git log --pretty="%H" -n1 HEAD
    Executing command (C:\OSPanel\domains\symfony.local): hg branch
    Executing command (C:\OSPanel\domains\symfony.local): fossil branch list
    Executing command (C:\OSPanel\domains\symfony.local): fossil tag list
    Executing command (C:\OSPanel\domains\symfony.local): svn info --xml
    Reading C:/Users//AppData/Roaming/Composer/composer.json
    Loading config file C:/Users//AppData/Roaming/Composer/composer.json
    Reading C:\OSPanel\domains\symfony.local/vendor/composer/installed.json
    Reading C:/Users//AppData/Roaming/Composer/vendor/composer/installed.json
    Loading plugin Symfony\Flex\Flex_composer_tmp0
    Reading ./composer.lock
    Loading composer repositories with package information
    Downloading https://repo.packagist.org/packages.json
    Writing C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/packages.json into cache
    Updating dependencies (including require-dev)
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/p-provider-2013.json from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/p-provider-2014.json from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/p-provider-2015.json from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/p-provider-2016.json from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/p-provider-2017.json from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/p-provider-2017-10.json from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/p-provider-2018-01.json from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/p-provider-2018-04.json from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/p-provider-2018-07.json from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/p-provider-archived.json from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/p-provider-latest.json from cache
    Downloading http://repo.packagist.org/p/sensio/framework-extra-bundle%24824a93ff7934a40854d0cf20ee4ef3de013ce7f0790225797560b3db5fc4db32.json
    Downloading http://repo.packagist.org/p/symfony/console%24fd53b9dd470a509aeac9ac931248f8fc0a89b0cdb777d847fb9a2e9dc8956748.json
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/provider-symfony$flex.json from cache
    Downloading http://repo.packagist.org/p/symfony/framework-bundle%244abe0f6ce4b891930b7ab69c336bf7a43ac420720b847f979fbb64293bf3b704.json
    Downloading http://repo.packagist.org/p/symfony/twig-bundle%24230aed0efc4b1adf14e9566a9524886c41dfe042ad0f292a03e0a15f05274ed7.json
    Downloading http://repo.packagist.org/p/symfony/web-server-bundle%249fbc7598d22792d1a08b5f46288eb990ec991e0947f719f63cdb7d4a297141b7.json
    Downloading http://repo.packagist.org/p/symfony/yaml%2415bfafe1558abff05b9882fa4d2f0be91f6568354bf7bf3461ea599ef98bc32b.json
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/provider-sensiolabs$security-checker.json from cache
    Downloading http://repo.packagist.org/p/symfony/dotenv%248f4453dcba914a707411181732261765d25031e0d93562a41395b47cb2a05716.json
    Downloading http://repo.packagist.org/p/sensio/framework-extra-bundle%24824a93ff7934a40854d0cf20ee4ef3de013ce7f0790225797560b3db5fc4db32.json
    Downloading http://repo.packagist.org/p/symfony/console%24fd53b9dd470a509aeac9ac931248f8fc0a89b0cdb777d847fb9a2e9dc8956748.json
    Downloading http://repo.packagist.org/p/symfony/framework-bundle%244abe0f6ce4b891930b7ab69c336bf7a43ac420720b847f979fbb64293bf3b704.json
    Downloading http://repo.packagist.org/p/symfony/twig-bundle%24230aed0efc4b1adf14e9566a9524886c41dfe042ad0f292a03e0a15f05274ed7.json
    Downloading http://repo.packagist.org/p/symfony/web-server-bundle%249fbc7598d22792d1a08b5f46288eb990ec991e0947f719f63cdb7d4a297141b7.json
    Downloading http://repo.packagist.org/p/symfony/yaml%2415bfafe1558abff05b9882fa4d2f0be91f6568354bf7bf3461ea599ef98bc32b.json
    Downloading http://repo.packagist.org/p/symfony/dotenv%248f4453dcba914a707411181732261765d25031e0d93562a41395b47cb2a05716.json
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/provider-doctrine$annotations.json from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/provider-doctrine$cache.json from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/provider-doctrine$collections.json from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/provider-doctrine$common.json from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/provider-doctrine$event-manager.json from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/provider-doctrine$inflector.json from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/provider-doctrine$lexer.json from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/provider-doctrine$persistence.json from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/provider-doctrine$reflection.json from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/provider-psr$cache.json from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/provider-psr$container.json from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/provider-psr$log.json from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/provider-psr$simple-cache.json from cache
    Downloading http://repo.packagist.org/p/symfony/cache%247a12d649479f0cea225e7bb69d94a563712728191e2c9359cae74471b34b4001.json
    Downloading http://repo.packagist.org/p/symfony/config%24a2040d681271062671ea17ef14ac65265bc25aafa29ad3ba3f8569e3f125e124.json
    Downloading http://repo.packagist.org/p/symfony/debug%24906a2319276f8bdef5c1e661f5f7c1510c56d2793f97cfb8f639fe5fa633ce12.json
    Downloading http://repo.packagist.org/p/symfony/dependency-injection%24fbf178cb6aee3d06d63b44bb0b1fff5bd56b28a60d9399baba996896c9219d26.json
    Downloading http://repo.packagist.org/p/symfony/event-dispatcher%2493213f9092b6723e0f46400756ba06273d18f2352892ba8a8f3c35242d84a234.json
    Downloading http://repo.packagist.org/p/symfony/filesystem%245b0348c93d12b678b13da7b593ebdd209bb27bfeeb4487c91c71c05091ac0c08.json
    Downloading http://repo.packagist.org/p/symfony/finder%24905e184c41a712c006d184665d2828fb7e994a485efcaff15ba1b4c7fea7cda5.json
    Downloading http://repo.packagist.org/p/symfony/http-foundation%241f721dc466371c3f710e101201a6988c782f0800c96c000fd1af0148a9d7ca61.json
    Downloading http://repo.packagist.org/p/symfony/http-kernel%24351254c0ca4f4f4e9d159a7ae835202ec15a50fe0a50568d5f49df97afa8fec7.json
    Downloading http://repo.packagist.org/p/symfony/polyfill-mbstring%245d5bc19404993875d45260435a22d0c8aec75dfb596f9487b6d16880c404b275.json
    Downloading http://repo.packagist.org/p/symfony/process%241c32520f40a78c6e4c36d67f0f75540b64461d32f1b62f6244793638e058f0ab.json
    Downloading http://repo.packagist.org/p/symfony/routing%24017a7bae2c0400b83a0f2a48e199abe518921d893e7f3608e6b6769a524a68ff.json
    Downloading http://repo.packagist.org/p/symfony/twig-bridge%24b8cb734f26795df10ac35c21865689357c1e4b895b822d2386fbe024421bf662.json
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/provider-twig$twig.json from cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/provider-composer$ca-bundle.json from cache
    Downloading http://repo.packagist.org/p/symfony/polyfill-ctype%24a19f3a2db80767fb6d2d54662c29889467509dcd70321e6fcf97208566954c53.json
    Writing C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/provider-symfony$polyfill-ctype.json into cache
    Writing C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/provider-symfony$twig-bridge.json into cache
    Restricting packages listed in "symfony/symfony" to "4.1.*"
    Downloading http://repo.packagist.org/p/symfony/form%247d8a3b6b3fd07eb7692cdfe5d8aec96bbfffb26b5da684711c7068d7c94eadfc.json
    Writing C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/provider-symfony$form.json into cache
    Downloading http://repo.packagist.org/p/symfony/intl%240c3967d4a571978872a8585e49fd4b6616e615972a20d4d26de05482b8c6b14e.json
    Downloading http://repo.packagist.org/p/symfony/options-resolver%2479fd7388bdd52915d9b2ecd251fe10616d4d21bd3d4971bad0b67badea093c58.json
    Downloading http://repo.packagist.org/p/symfony/property-access%24a3529c6d69b76e6ad8c474ee4efe9f6baa05ce74a91e0235314678819bdd89f5.json
    Downloading http://repo.packagist.org/p/phpunit/phpunit%24874795fac5bee055830aa2a2161bd16b6e6b963c46e7a9a19d3554836810dbb1.json
    Downloading http://repo.packagist.org/p/symfony/doctrine-bridge%24705fe70a3791669271a34f58580ef03706d4467e14148892bc9a531ca222805b.json
    Writing C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/provider-symfony$doctrine-bridge.json into cache
    Writing C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/provider-phpunit$phpunit.json into cache
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/provider-phpunit$php-code-coverage.json from cache
    Downloading http://repo.packagist.org/p/phpunit/php-file-iterator%24d1ae1870b74e3bec501ebaa8a6a0d976b62860ab403969ec4ca0e24682962ea5.json
    Reading C:/Users//AppData/Local/Composer/repo/https---repo.packagist.org/provider-phpunit$php-text-template.json from cache

  • 2018-09-07 Diego Aguiar

    Hey Алексей Скоробогатов

    Which version of Symfony are you using?
    Could you run that command again but passing it "-vvv" so we can see more logs

    Cheers!

  • 2018-09-07 Алексей Скоробогатов

    after installation sec-checker

    Executing script security-checker security:check [KO]
    [KO]
    Script security-checker security:check returned with error code 1
    !!
    !! An error occurred: .
    !!
    !!
    Script @auto-scripts was called via post-update-cmd

  • 2018-08-07 Dean Dyer

    right on weaver. yes I got it to work with the git config --global core.auto.
    I found that on stackoverflow. Thank you.

  • 2018-08-06 weaverryan

    Hey Dean Dyer!

    Let's walk through each line :).

    > Reinitialized existing Git repository in C:/Users/desig/Desktop/apps/the_spacebar/.git/

    That's ok. It just means that there was already a git repository initialized in this directory - maybe because you already ran this command when trying to debug the issue, or used a GUI to initialize the repo. Regardless, it's not a problem - git is basically saying "Hey! There's already a git repo in this directory".

    > fatal: CRLF would be replaced by LF in src/Controller/ArticleController.php

    So, this is an annoying one :/. Windows & Linux-based systems use different line endings. And so git can get confused by this - it *wants* to use a certain line ending because you're on Windows, but the code uses a different line ending. It's sort of a famous, annoying issue that Windows users face. But it's ultimately superficial. Here are some details on it: https://stackoverflow.com/q...

    One solution would be to run:


    git config --global core.autocrlf false
    git config --global core.safecrlf false

    This tells git not to worry about the line endings: to keep them how you have them. After this, you should be able to run "git add ." again to initialize the git repo. Also, if you like using a GUI better, check out https://desktop.github.com/

    > $ git commit -m "making so much good progress"
    > On branch master
    > Your branch is up to date with 'origin/master'.

    This is the effect if the "git add ." command failing because of the line ending stuff. Nothing was "added" to git, so nothing was able to be committed.

    Btw, if you want to learn a lot more about Git, there's a great site where you can play with it - I highly recommend :) https://learngitbranching.j...

    Cheers!

  • 2018-08-06 Dean Dyer

    thank you .
    but now I'm getting all this :
    $ git init
    Reinitialized existing Git repository in C:/Users/desig/Desktop/apps/the_spacebar/.git/

    desig@Deans-A-Gamer MINGW64 ~/Desktop/apps/the_spacebar (master)$ git add .
    fatal: CRLF would be replaced by LF in src/Controller/ArticleController.php.

    desig@Deans-A-Gamer MINGW64 ~/Desktop/apps/the_spacebar (master)
    $ git commit -m "making so much good progress"
    On branch master
    Your branch is up to date with 'origin/master'.

    Changes not staged for commit:
    modified: composer.json
    modified: composer.lock
    modified: config/bundles.php
    modified: config/routes.yaml
    modified: symfony.lock

    Untracked files:
    config/packages/security_checker.yaml
    config/packages/sensio_framework_extra.yaml
    config/routes/
    src/Controller/ArticleController.php

    no changes added to commit

  • 2018-08-06 weaverryan

    Hey Dean Dyer!

    Ah, sorry about that! Try running this first:


    git init

    And THEN run the git add . and git status. After we recorded the screencast, Symfony *stopped* making the git repository for you. It's no big deal - except that it made this part of our screencast inaccurate :/. We'll be adding a note soon to help with this - sorry it confused you - we definitely do not want that!

    So, run "git init", then keep going!

    Cheers!

  • 2018-08-06 Dean Dyer

    so I am getting this operation must be run in a work tree when I type into the terminal git add . or git status..... this is after I pushed up the initial repository, that symfony did not make for me. I can not find the solution to this anywhere. Please advise.

  • 2018-06-21 Victor Bocharsky

    Hey Daniel,

    Haha, where did you find that "run" command in our screencasts? The command should be "git diff composer.json", the "run" was just a word, a simple verb ;)

    Cheers!

  • 2018-06-09 Tasatko

    for now passed without any errors. ty!

  • 2018-06-08 Victor Bocharsky

    Hey Tasatko,

    Could you show the entire command you're trying to execute? Looks like your have a misprint in it. Please, double check the command is:
    composer require sec-checker --dev

    Because --dev does not mean the version of "sensiolabs/security-checker" but that this package should be installed in dev section, i.e. "require-dev".

    Btw, what version of Composer do you use? Could you try to upgrade to the latest available version?

    Cheers!

  • 2018-06-07 Tasatko

    about --dev version: Could not find package sensiolabs/security-checker in a version matching dev

  • 2018-02-22 Victor Bocharsky

    Hey Dmitriy,

    Uh oh, looks like this bundle does not have a release which supports Symfony 4 yet so... you have a few options:
    1. Look at composer.json in master branch, probably this bundle already supports Symfony 4 but does not have a stable release yet. Well, I see master branch does not support Symfony 4 yet :)
    2. Help author to add Symfony 4 support by submitting a PR if nobody haven't done it yet - probably there's already one which exists but haven't merged yet. Well, see the related issue: https://github.com/egeloen/...
    3. Make a fork of this bundle, add support of Symfony 4 and use your fork in composer.json file - but this way you won't have new updates from the bundle, well, you need to merge it manually into your fork in the future

    Cheers!

  • 2018-02-22 Дмитрий Ченгаев

    I would like to install the egeloen/ckeditor-bundle package on my Symfony 4, but I get an error "requires symfony/form ^2.7|^3.0". How can I use this package on Symfony 4?