我们必须在已经在使用此包的项目中的模块中使用GuzzleHttp。
[GuzzleHttp / Exception / RequestException尝试加载GuzzleHttp \ Psr7 \ get_message_body_summary(),它不会加载该函数,因为会抛出该错误:
'Whoops\Exception\ErrorException' with message 'Call to undefined function GuzzleHttp\Psr7\get_message_body_summary()' in ...
未加载功能,因为:
// Don't redefine the functions if included multiple times.
if (!function_exists('GuzzleHttp\Psr7\str')) {
require __DIR__ . '/functions.php'; // <<< get_message_body_summary() is here
}
它看到get_message_body_summary()在主项目的GuzzleHttp中不存在。
我不知道该怎么办才能解决问题...
嗯,我仍然有兼容性问题。我认为最好的选择是将软件包克隆到插件中:
How does composer handle multiple versions of the same package?