Suppress quot;Ambiguous class resolutionquot; warning on composer dump-autoload -o(禁止“模糊类解析;作曲家转储自动加载 -o 上的警告)
问题描述
我的情况如下:
我想通过 openshift 上的git push"部署一个 php-app.依赖关系通过作曲家解决.composer.lock 文件(将依赖项锁定到特定的所需版本)是存储库的一部分.
I want to deploy a php-app via "git push" on openshift. Dependencies are resolved via composer. The composer.lock file (locking the dependencies to the specific wanted version) is part of the repository.
使用 deploy
钩子脚本加载依赖项:
Dependencies are loaded using the deploy
hook script using:
${PHP_DIR}/bin/php $OPENSHIFT_DATA_DIR/composer.phar update --prefer-dist --no-dev -n
${PHP_DIR}/bin/php $OPENSHIFT_DATA_DIR/composer.phar dump-autoload --optimize -n
其中一个依赖项(htmlpurifier)是子依赖项的依赖项.在第二个命令(dump-autoload --optimize)期间,一个抱怨不明确的类解析"的错误被写入 stderr(我想),导致部署失败.代码在本地使用单元/集成测试进行测试,并证明可以工作,即使使用这个错误的包.
One of the dependencies (htmlpurifier) is a dependency of a subdependency. During the second command (dump-autoload --optimize) an error complaining about a "Ambiguous class resolution"-warning is written to stderr(I suppose), causing the deploy to fail. Code is tested locally using unit/integration tests and proven to work, even with this erroneous package.
远程:警告:不明确的类解析,HTML5"在两个/var/lib"中都找到/openshift/abc/app-root/runtime/repo/vendor/ezyang/htmlpurifier/maintenance/PH5P.php"和/var/lib/openshift/abc/app-根/运行时/repo/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/PH5P.php",将使用第一个.
remote: Warning: Ambiguous class resolution, "HTML5" was found in both "/var/lib /openshift/abc/app-root/runtime/repo/vendor/ezyang/htmlpuri fier/maintenance/PH5P.php" and "/var/lib/openshift/abc/app- root/runtime/repo/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/PH5P.php ", the first will be used.
他们是否可以忽略此特定警告(例如未记录的选项),而不忽略命令生成的所有其他警告和/或消息?或者是否可以从自动加载优化中排除特定的子依赖项以避免警告并让部署成功而不忽略所有可能的错误?
Is their a way to ignore this specific warning (e.g. an undocumented option), without ignoring all other warnings and/or messages generated by the command? Or is it possible to exclude a specific subdependency from autoload optimization to avoid the warning and let deploy succeed without ignoring all possible errors?
推荐答案
在对作曲家用户列表进行讨论后,此问题已修复
After a discussion on the composer-user list this has been fixed in
https://github.com/composer/composer/commit/05d9912f97a2decf6a5c08dfa569dcf23d79b16d
如果其他人遇到此问题,请使用
If anyone else runs into this, update composer to the latest version using
composer selfupdate
这篇关于禁止“模糊类解析";作曲家转储自动加载 -o 上的警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:禁止“模糊类解析";作曲家转储自动加载 -o 上的警告
基础教程推荐
- 在 PHP 中强制下载文件 - 在 Joomla 框架内 2022-01-01
- 在多维数组中查找最大值 2021-01-01
- 在 Woocommerce 中根据运输方式和付款方式添加费用 2021-01-01
- 如何在 PHP 中的请求之间持久化对象 2022-01-01
- Libpuzzle 索引数百万张图片? 2022-01-01
- mysqli_insert_id 是否有可能在高流量应用程序中返回 2021-01-01
- WooCommerce 中选定产品类别的自定义产品价格后缀 2021-01-01
- XAMPP 服务器不加载 CSS 文件 2022-01-01
- 超薄框架REST服务两次获得输出 2022-01-01
- 通过 PHP SoapClient 请求发送原始 XML 2021-01-01