抑制“模糊类分辨率”警告在composer dump-autoload -o [英] Suppress "Ambiguous class resolution" warning on composer dump-autoload -o

查看:1148
本文介绍了抑制“模糊类分辨率”警告在composer dump-autoload -o的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我处于以下情况:

我想通过git push在openshift上部署一个php应用程序。依赖关系通过composer解析。 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 hook脚本使用:

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)期间,抱怨Ambiguous类解析的错误 - 警告写入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.


remote:警告:模糊的类解析,使用单位/集成测试,在/ var / lib
/ openshift / abc / app-root / runtime / repo / vendor / ezyang / htmlpuri
fier / maintenance / PH5P.php和/ var / lib / openshift / abc / app-
root / runtime / 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

这篇关于抑制“模糊类分辨率”警告在composer dump-autoload -o的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆