如何从symfony 4.4 LTS项目中正确删除sensiolabs/security-checker



我有一个Symfony 4.4代码库,我需要删除现在已弃用的安全检查器包。但是简单运行composer remove sensiolabs/security-checker不能正确移除包

composer remove sensiolabs/security-checker
./composer.json has been updated
Running composer update sensiolabs/security-checker
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 0 updates, 2 removals
- Removing composer/ca-bundle (1.2.9)
- Removing sensiolabs/security-checker (v5.0.3)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 0 updates, 2 removals
- Removing sensiolabs/security-checker (v5.0.3)
- Removing composer/ca-bundle (1.2.9)
Generating autoload files
composer/package-versions-deprecated: Generating version class...
composer/package-versions-deprecated: ...done generating version class
84 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Symfony operations: 2 recipes (acd31206aa63ca25126df4f0b5f09748)
- Unconfiguring sensiolabs/security-checker (>=4.0): From github.com/symfony/recipes:master
- Unconfiguring composer/ca-bundle (>=1.2.9): From auto-generated recipe
Synchronizing package.json with PHP packages
Don't forget to run npm install --force or yarn install --force to refresh your JavaScript dependencies!
Executing script cache:clear [KO]
[KO]
Script cache:clear returned with error code 1
!!
!!  In AddConsoleCommandPass.php line 53:
!!
!!    Class "SensioLabsSecurityCommandSecurityCheckerCommand" used for service
!!     "SensioLabsSecurityCommandSecurityCheckerCommand" cannot be found.
!!
!!
!!
Script @auto-scripts was called via post-update-cmd

我清除(并删除)缓存,我也重置(删除并重新安装)供应商一次。

但是我总是得到senolabs SecurityCommandSecurityCheckerCommand not found error.

似乎有些部分仍然由composer.json@auto-scripts条目调用?

composer.json

{
"type": "project",
"license": "proprietary",
"require": {
"php": "^7.1.3",
"ext-ctype": "*",
"ext-iconv": "*",
"ext-json": "*",
"ext-mbstring": "*",
"ext-bcmath": "*",
"ext-simplexml": "*",
"sensio/framework-extra-bundle": "^5.2",
"symfony/asset": "*",
"symfony/console": "*",
"symfony/expression-language": "*",
"symfony/finder": "*",
"symfony/flex": "^1.2",
"symfony/form": "*",
"symfony/framework-bundle": "*",
"symfony/monolog-bundle": "^3.1",
"symfony/orm-pack": "*",
"symfony/security-bundle": "*",
"symfony/swiftmailer-bundle": "^3.2",
"symfony/templating": "*",
"symfony/translation": "*",
"symfony/twig-bundle": "*",
"symfony/validator": "*",
"symfony/webpack-encore-bundle": "^1.6",
"symfony/yaml": "*"
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^3.0",
"symfony/debug-pack": "*",
"symfony/dotenv": "*",
"symfony/phpunit-bridge": "*",
"symfony/profiler-pack": "^1.0"
},
"config": {
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\": "src/App/",
}
},
"autoload-dev": {
"psr-4": {
"App\Tests\": "tests/App/"
}
},
"replace": {
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php71": "*",
"symfony/polyfill-php70": "*",
"symfony/polyfill-php56": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
"@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "4.4.*"
}
}
}

删除security_checker。从你的配置文件

您还需要从编写器中删除它。json"auto-scripts"部分,您可能会有这样的内容:

"auto-scripts": {
...
"security-checker security:check": "script"
},

最新更新