orangephp/curl-to-cli
Composer 安装命令:
composer require orangephp/curl-to-cli
包简介
CurlToCLI is a Orange PHP, LLC, Project meant to convert standard `curl_exec()` calls to `curl` CLI commands.
README 文档
README
CurlToCLI is a Orange PHP, LLC, Project meant to convert standard curl_exec() calls to curl CLI commands.
This makes it trivial to export even complex PHP curl calls to Postman, Insomnia or other dev teams.
Installation
Via Composer
composer require --dev orangephp/curl-to-cli
Usage
You must properly prepend the OrangePHP\ namespace every single curl_ function call.
Then call OrangePHP\convert_to_cli();
$handler = OrangePHP\curl_init($this->endpoint . $url); OrangePHP\curl_setopt($handler, CURLOPT_HTTPHEADER, $headers); OrangePHP\curl_setopt($handler, CURLOPT_TIMEOUT, 65); OrangePHP\curl_setopt($handler, CURLOPT_POSTFIELDS, $jsonData); OrangePHP\curl_setopt($handler, CURLOPT_POST, 1); OrangePHP\curl_setopt($handler, CURLOPT_CUSTOMREQUEST, $customRequest); OrangePHP\curl_setopt($handler, CURLOPT_RETURNTRANSFER, true); OrangePHP\curl_setopt($handler, CURLOPT_SSL_VERIFYPEER, $this->verifySSL); $response = OrangePHP\curl_exec($handler); $httpCode = OrangePHP\curl_getinfo($handler, CURLINFO_HTTP_CODE); $curlCLICommand = OrangePHP\convert_to_cli(); error_log("CURL CLI: $curlCLICommand");
Use cases
✔ Rapidly start up a project right.
✔ Less time spent on boilerplating a git repo.
✔ Conforms to the most widely-deployed PHP layout.
✔ Fully compatible with the Bettergist Collective recommendation.
Testing
phpunit --testdox
License
MIT license. Please see the license file for more information. :wq
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-07-01