Closed aogg closed 5 years ago
你现有composer的内容 "extra": { "class": "Yurun\Util\Swoole\Guzzle\Plugin\Plugin", "include_files": [ "src/load.php", "src/functions.php" ] },
但现有github目录中却没有load这个文件,这是为什么
load.php
是通过读取源代码,修改后,写入的
你是执行了什么命令出现的这个问题?
composer require
composer配置为: "post-create-project-cmd": [ "@php artisan key:generate" ], "post-autoload-dump": [ "Illuminate\Foundation\ComposerScripts::postAutoloadDump", "@php artisan package:discover" ]
composer.json
中还需要手动进行引用guzzle
{
"require": {
"guzzlehttp/guzzle": "~6.0",
"yurunsoft/guzzle-swoole": "^1.1"
}
}
你试一下
@aogg @Yurunsoft
測試後發現當composer.json
的post-autoload-dump
含有
Illuminate\\Foundation\\ComposerScripts::postAutoloadDump
便會報錯
post-autoload-dump
改為以下寫法便可:
"post-autoload-dump": [
"rm -f bootstrap/cache/services.php",
"rm -f bootstrap/cache/packages.php",
"@php artisan package:discover"
]
效果與Laravel 5.7的Illuminate\\Foundation\\ComposerScripts::postAutoloadDump
一致,雖然這樣修改是比較不優雅,但希望能幫到你們
Generating optimized autoload files
Fatal error: Cannot redeclare GuzzleHttp\uri_template() (previously declared in /www/n8n8/SmartCloud/vendor/guzzlehttp/guzzle/src/functions.php:17) in /www/n8n8/SmartCloud/vendor/yurunsoft/guzzle-swoole/src/load.php on line 31