我安装了没有弃用的Symfony 3.4.9。所以我将固件升级到4.1.1。现在,我收到了9个弃用警告,所有警告均来自供应商库:
- 不赞成创建Doctrine \ ORM \ Mapping \ UnderscoreNamingStrategy而不通知其编号的做法已被弃用,并将在Doctrine ORM 3.0中将其删除。
- 从Symfony 4.4开始,不推荐使用“ Symfony \ Component \ HttpKernel \ EventListener \ ExceptionListener”类,请改用“ ErrorListener”。
- 从学说/持久性1.3开始不建议使用Doctrine \ Common \ Persistence \ Mapping \ AbstractClassMetadataFactory类,并且在2.0中将删除该类。请改用\ Doctrine \ Persistence \ Mapping \ AbstractClassMetadataFactory。
- 从学说/持久性1.3开始,不建议使用Doctrine \ Common \ Persistence \ Mapping \ RuntimeReflectionService类,并将在2.0中删除它。请改用\ Doctrine \ Persistence \ Mapping \ RuntimeReflectionService。
- 从学说/持久性1.3开始不建议使用Doctrine \ Common \ Persistence \ ObjectManager类,而在2.0中将删除该类。请改用\ Doctrine \ Persistence \ ObjectManager。
- 从学说/持久性1.3开始不建议使用Doctrine \ Common \ Persistence \ ObjectRepository类,而在2.0中将删除该类。请改用\ Doctrine \ Persistence \ ObjectRepository。
- 从教义/持久性1.3开始不建议使用Doctrine \ Common \ PropertyChangedListener类,而在2.0中将删除该类。请改用\ Doctrine \ Persistence \ PropertyChangedListener。
- Symfony 4.4中已弃用“ twig.exception_controller”配置密钥,将其设置为“ null”,而改用“ framework.error_controller”配置密钥。(x2)
这是“正常”还是在composer.json文件中存在任何问题?我仔细检查过,看不到具有任何“固定”设置的任何依赖项。
我什至删除了完整的供应商文件夹,然后再次下载,因为我认为可能还剩下“垃圾”,结果相同。
我的composer.json文件:
{
"type" : "project",
"license" : "proprietary",
"require" : {
"php" : "^7.1.3",
"ext-ctype" : "*",
"ext-iconv" : "*",
"sensio/framework-extra-bundle" : "^5.2",
"symfony/apache-pack" : "^1.0",
"symfony/asset" : "4.4.*",
"symfony/console" : "4.4.*",
"symfony/dotenv" : "4.4.*",
"symfony/expression-language" : "4.4.*",
"symfony/flex" : "^1.1",
"symfony/form" : "4.4.*",
"symfony/framework-bundle" : "4.4.*",
"symfony/monolog-bundle" : "^3.1",
"symfony/orm-pack" : "*",
"symfony/process" : "4.4.*",
"symfony/security-bundle" : "4.4.*",
"symfony/serializer-pack" : "*",
"symfony/swiftmailer-bundle" : "^3.1",
"symfony/translation" : "4.4.*",
"symfony/twig-bundle" : "4.4.*",
"symfony/validator" : "4.4.*",
"symfony/web-link" : "4.4.*",
"symfony/webpack-encore-bundle" : "^1.1",
"symfony/yaml" : "4.4.*"
},
"require-dev" : {
"symfony/debug-pack" : "*",
"symfony/maker-bundle" : "^1.0",
"symfony/profiler-pack" : "^1.0",
"symfony/test-pack" : "*",
"symfony/web-server-bundle" : "4.4.*"
},
"config" : {
"preferred-install" : {
"*" : "dist"
},
"sort-packages" : true,
"secure-http" : false
},
"autoload" : {
"psr-4" : {
"App\\" : "src/"
}
},
"autoload-dev" : {
"psr-4" : {
"App\\Tests\\" : "tests/"
},
"classmap" : [
"vendor/phpasn1"
]
},
"replace" : {
"paragonie/random_compat" : "2.*",
"symfony/polyfill-ctype" : "*",
"symfony/polyfill-iconv" : "*",
"symfony/polyfill-php71" : "*",
"symfony/polyfill-php70" : "*",
"symfony/polyfill-php56" : "*"
},
"conflict" : {
"symfony/symfony" : "*"
},
"extra" : {
"symfony" : {
"allow-contrib" : false,
"require" : "4.4.*"
}
}
}
编辑
我检查了已安装的软件包,composer show
并发现至少有两个已安装的软件包与上面的弃用列表相关:
(...)
doctrine/orm v2.7.0 Object-Relational-Mapper for PHP
doctrine/persistence 1.3.3 The Doctrine Persistence project is a set of shared...
(...)
因此,我检查了这些软件包的可用版本,composer info doctrine/persistence --all
发现它已经安装了最新的非开发版本:
name : doctrine/persistence
descrip. : The Doctrine Persistence project is a set of shared interfaces and functionality that the different Doctrine object mappers share.
keywords : mapper, object, odm, orm, persistence
versions : dev-master, 2.0.x-dev, 1.3.x-dev, * 1.3.3, 1.3.2, 1.3.1, 1.3.0, 1.2.x-dev, 1.2.0, 1.1.x-dev, 1.1.1, v1.1.0, 1.0.x-dev, v1.0.1, v1.0.0, dev-1.3.x-merge-up-into-master_5df35c38f354a9.94042071, dev-1.3.x-merge-up-into-master_5df33dc289ea03.65167777, dev-1.3.x-merge-up-into-master_5df29d964b0aa5.96685696, dev-github-funding, dev-master-old
(...)
相同doctrine-orm
。
GitHub站点上的doctrine / persistence似乎也证实了这一点:https : //github.com/doctrine/persistence/releases
因此,这使我认为这确实是正常的行为,并且将来在更新这些软件包时,弃用消息将消失。
解决方案说明
正如已经阅读了接受的答案的任何人都会注意到的那样,仍有5个弃用尚不能解决。我将提供一个答案ASA对此有修复。如果有人在我之前注意到这一点,请随意添加此问题的答案。谢谢。
trace
链接查看堆栈跟踪并查明它们的来源。:)
ObjectManager
)到达这里的,它帮助我了解了发生了什么。