問題描述
我處于以下情況:
我想在 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模板網!