<i id='fpLbN'><tr id='fpLbN'><dt id='fpLbN'><q id='fpLbN'><span id='fpLbN'><b id='fpLbN'><form id='fpLbN'><ins id='fpLbN'></ins><ul id='fpLbN'></ul><sub id='fpLbN'></sub></form><legend id='fpLbN'></legend><bdo id='fpLbN'><pre id='fpLbN'><center id='fpLbN'></center></pre></bdo></b><th id='fpLbN'></th></span></q></dt></tr></i><div id='fpLbN'><tfoot id='fpLbN'></tfoot><dl id='fpLbN'><fieldset id='fpLbN'></fieldset></dl></div>

    <legend id='fpLbN'><style id='fpLbN'><dir id='fpLbN'><q id='fpLbN'></q></dir></style></legend>
    <tfoot id='fpLbN'></tfoot>

      • <bdo id='fpLbN'></bdo><ul id='fpLbN'></ul>
    1. <small id='fpLbN'></small><noframes id='fpLbN'>

        抑制“歧义类解析"对作曲家 dump-autoload -o 的

        时间:2023-10-04

        <small id='3Sbf9'></small><noframes id='3Sbf9'>

        <legend id='3Sbf9'><style id='3Sbf9'><dir id='3Sbf9'><q id='3Sbf9'></q></dir></style></legend>
            • <bdo id='3Sbf9'></bdo><ul id='3Sbf9'></ul>

                <tfoot id='3Sbf9'></tfoot>

                  <i id='3Sbf9'><tr id='3Sbf9'><dt id='3Sbf9'><q id='3Sbf9'><span id='3Sbf9'><b id='3Sbf9'><form id='3Sbf9'><ins id='3Sbf9'></ins><ul id='3Sbf9'></ul><sub id='3Sbf9'></sub></form><legend id='3Sbf9'></legend><bdo id='3Sbf9'><pre id='3Sbf9'><center id='3Sbf9'></center></pre></bdo></b><th id='3Sbf9'></th></span></q></dt></tr></i><div id='3Sbf9'><tfoot id='3Sbf9'></tfoot><dl id='3Sbf9'><fieldset id='3Sbf9'></fieldset></dl></div>
                    <tbody id='3Sbf9'></tbody>
                  本文介绍了抑制“歧义类解析"对作曲家 dump-autoload -o 的警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我处于以下情况:

                  我想在 openshift 上通过git push"部署一个 php 应用程序.依赖项通过 Composer 解决.composer.lock 文件(将依赖项锁定到所需的特定版本)是存储库的一部分.

                  使用 deploy 钩子脚本加载依赖项:

                  ${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(我想),导致部署失败.代码使用单元/集成测试在本地进行测试,并被证明可以工作,即使使用这个错误的包也是如此.

                  <块引用>

                  远程:警告:类解析不明确,在/var/lib"中都找到了HTML5"/openshift/abc/app-root/runtime/repo/vendor/ezyang/htmlpurifier/maintenance/PH5P.php"和/var/lib/openshift/abc/app-root/runtime/repo/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/PH5P.php",将使用第一个.

                  他们是否可以忽略此特定警告(例如未记录的选项),而不忽略命令生成的所有其他警告和/或消息?或者是否可以从自动加载优化中排除特定的子依赖项以避免警告并让部署成功而​​不忽略所有可能的错误?

                  解决方案

                  经过对 composer-user 列表的讨论,此问题已在

                  https://github.com/composer/composer/commit/05d9912f97a2097dfa2f95a20cdf6d/p>

                  如果其他人遇到此问题,请使用

                  将 Composer 更新到最新版本

                  作曲家自我更新

                  I'm in the follwoing situation:

                  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.

                  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
                  

                  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: 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
                  

                  这篇关于抑制“歧义类解析"对作曲家 dump-autoload -o 的警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何为 PHP/MySQL 应用程序自动迁移(架构和数据) 下一篇:如何开始从 subversion 存储库部署 PHP 应用程序?

                  相关文章

                  最新文章

                • <tfoot id='ToBwx'></tfoot>
                    <bdo id='ToBwx'></bdo><ul id='ToBwx'></ul>

                      <legend id='ToBwx'><style id='ToBwx'><dir id='ToBwx'><q id='ToBwx'></q></dir></style></legend>

                      <small id='ToBwx'></small><noframes id='ToBwx'>

                      <i id='ToBwx'><tr id='ToBwx'><dt id='ToBwx'><q id='ToBwx'><span id='ToBwx'><b id='ToBwx'><form id='ToBwx'><ins id='ToBwx'></ins><ul id='ToBwx'></ul><sub id='ToBwx'></sub></form><legend id='ToBwx'></legend><bdo id='ToBwx'><pre id='ToBwx'><center id='ToBwx'></center></pre></bdo></b><th id='ToBwx'></th></span></q></dt></tr></i><div id='ToBwx'><tfoot id='ToBwx'></tfoot><dl id='ToBwx'><fieldset id='ToBwx'></fieldset></dl></div>