庆云php

庆云php

tp6安装GuzzleHttp,一句话安装composer require guzzlehttp/guzzle

PHP 0

GuzzleHttp是什么?

简单的说,Guzzle是一个PHP的HTTP客户端,用来轻而易举地发送请求,并集成到我们的WEB服务上,类似php本身的curl命令一样,访问域名,他比curl更加好用,适用场景:
  1. 需要访问别人接口的时候,比如微信登录,需要php访问微信拿到用户数据
  2. 访问另一个项目的接口

安装GuzzleHttp

到项目目录下使用composer安装
composer require guzzlehttp/guzzle
Microsoft Windows [版本 10.0.19044.1288] (c) Microsoft Corporation。保留所有权利。 D:\php\gougucmszsk>composer require guzzlehttp/guzzle Info from https://repo.packagist.org: #StandWithUkraine Using version ^7.5 for guzzlehttp/guzzle ./composer.json has been updated Running composer update guzzlehttp/guzzle Loading composer repositories with package information Updating dependencies Lock file operations: 30 installs, 0 updates, 0 removals - Locking firebase/php-jwt (v6.1.2) - Locking guzzlehttp/guzzle (7.5.0) - Locking guzzlehttp/promises (1.5.2) - Locking guzzlehttp/psr7 (2.4.1) - Locking league/flysystem (1.1.9) - Locking league/flysystem-cached-adapter (1.1.0) - Locking league/mime-type-detection (1.11.0) - Locking phpmailer/phpmailer (v6.6.4) - Locking psr/cache (1.0.1) - Locking psr/container (1.1.2) - Locking psr/http-client (1.0.1) - Locking psr/http-factory (1.0.1) - Locking psr/http-message (1.0.1) - Locking psr/log (1.1.4) - Locking psr/simple-cache (1.0.1) - Locking ralouphie/getallheaders (3.0.3) - Locking symfony/deprecation-contracts (v3.0.2) - Locking symfony/polyfill-mbstring (v1.26.0) - Locking symfony/polyfill-php72 (v1.26.0) - Locking symfony/polyfill-php80 (v1.26.0) - Locking symfony/var-dumper (v4.4.44) - Locking symfony/var-exporter (v5.4.10) - Locking topthink/framework (v6.0.13) - Locking topthink/think-captcha (v3.0.7) - Locking topthink/think-helper (v3.1.6) - Locking topthink/think-multi-app (v1.0.14) - Locking topthink/think-orm (v2.0.54) - Locking topthink/think-template (v2.0.8) - Locking topthink/think-trace (v1.4) - Locking topthink/think-view (v1.0.14) Writing lock file Installing dependencies from lock file (including require-dev) Package operations: 7 installs, 1 update, 0 removals - Downloading symfony/deprecation-contracts (v3.0.2) - Downloading psr/http-client (1.0.1) - Downloading ralouphie/getallheaders (3.0.3) - Downloading psr/http-factory (1.0.1) - Downloading guzzlehttp/psr7 (2.4.1) - Downloading guzzlehttp/promises (1.5.2) - Downloading guzzlehttp/guzzle (7.5.0) - Downloading phpmailer/phpmailer (v6.6.4) - Installing symfony/deprecation-contracts (v3.0.2): Extracting archive - Installing psr/http-client (1.0.1): Extracting archive - Installing ralouphie/getallheaders (3.0.3): Extracting archive - Installing psr/http-factory (1.0.1): Extracting archive - Installing guzzlehttp/psr7 (2.4.1): Extracting archive - Installing guzzlehttp/promises (1.5.2): Extracting archive - Installing guzzlehttp/guzzle (7.5.0): Extracting archive - Upgrading phpmailer/phpmailer (v6.6.3 => v6.6.4): Extracting archive 20 package suggestions were added by new dependencies, use `composer suggest` to see details. Generating autoload files > @php think service:discover Succeed! > @php think vendor:publish File D:\php\gougucmszsk\config\captcha.php exist! File D:\php\gougucmszsk\config\trace.php exist! Succeed! 12 packages you are using are looking for funding. Use the `composer fund` command to find out more! Found 1 security vulnerability advisory affecting 1 package. Run composer audit for a full list of advisories. D:\php\gougucmszsk>