惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Y
Y Combinator Blog
O
OpenAI News
K
Kaspersky official blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Hacker News: Ask HN
Hacker News: Ask HN
S
SegmentFault 最新的问题
L
Lohrmann on Cybersecurity
S
Securelist
C
CERT Recently Published Vulnerability Notes
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
IT之家
IT之家
Jina AI
Jina AI
大猫的无限游戏
大猫的无限游戏
V
Vulnerabilities – Threatpost
量子位
爱范儿
爱范儿
I
Intezer
博客园 - 叶小钗
The Hacker News
The Hacker News
N
News and Events Feed by Topic
Project Zero
Project Zero
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
P
Privacy & Cybersecurity Law Blog
Google Online Security Blog
Google Online Security Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
H
Heimdal Security Blog
NISL@THU
NISL@THU
V
Visual Studio Blog
The Last Watchdog
The Last Watchdog
Know Your Adversary
Know Your Adversary
Cisco Talos Blog
Cisco Talos Blog
P
Proofpoint News Feed
M
MIT News - Artificial intelligence
Stack Overflow Blog
Stack Overflow Blog
The Cloudflare Blog
小众软件
小众软件
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
S
Schneier on Security
雷峰网
雷峰网
B
Blog RSS Feed
美团技术团队
T
Threat Research - Cisco Blogs
Engineering at Meta
Engineering at Meta
Recent Announcements
Recent Announcements
N
Netflix TechBlog - Medium
月光博客
月光博客
S
Security Affairs

博客园 - 幸福的菜菜

windows下使用ACME申请SSL证书的办法 ElementPlus Radio 实现双击取消选择的效果 Windows10 LTSC版本 无法访问网络中部分的共享文件夹 SqlSugar : date绑定到XX失败,可以试着换一个类型,或者使用ORM自定义类型实现 VisualStudio Debug模式突然变慢 Visual Stadio 编译提示 The BaseOutputPath/OutputPath property is not set for project ... winform绘图与前端canvas绘图效率对比 node-sass编译不通过, 提示 “checking for Python executable "python2" in the PATH” c# async await的使用方式及为啥要用它 winform 实现对usb热拔插的监听 Laravel The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths Wampserver 配置端口可访问服务 git credential for windows 总是弹出的问题 如何用B表的数据,更新A表的值 WampServer部署https 服务的过程 Windows下 Docker 简单部署 Django应用 C#实现后台格式化U盘的功能 Winform 实现断点续传的思路及代码 WAMPServer ServerName has syntax error 的问题(阿里云服务器上)
PHP 命名空间冲突解决方式
幸福的菜菜 · 2019-02-27 · via 博客园 - 幸福的菜菜

在Laravel项目中,自己定义了一Client对象。

在使用GuzzleHttp 发起请求的时候,报了Client对象的冲突

有两种解决方式

1  对某一个命名空间起别名

1 use App\Client;
2 use GuzzleHttp\Client as GClient;
3 
4 
5 
6         $gclient = new GClient([
7             'base_uri' => env('APP_LandMindUrl','http://182.150.6.114:10005'),
8             'timeout'  => 2.0,
9         ]);

2 对其中一个命名空间使用绝对路径

1         $gclient = new \GuzzleHttp\Client([
2             'base_uri' => env('APP_LandMindUrl','http://182.150.6.114:10005'),
3             'timeout'  => 2.0,
4         ]);

需要特别注意,如果使用  GuzzleHttp\Client 则是使用相对路径,而不是项目的根路径。所以也一定会报错