Download the PHP package tuuz/net without Composer

On this page you can find all versions of the php package tuuz/net. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package net

TuuzNet

轻量级 cURL 基础的 PHP HTTP 客户端库,提供简洁的静态接口,支持 GET、POST(JSON/Form/File/Binary)、PUT、DELETE 等常见请求方式。

PHP Version Packagist


功能特性


安装

通过 Composer 安装:

要求:


快速开始

💡 也可以直接用全局类名 TuuzNet::xxx() 调用(无需 use 导入,由 helpers.php 自动注册 class_alias)。


API 参考

所有方法均为静态调用,抛出 \Exception 用于错误和超时处理。

通用参数说明

参数 类型 说明
$base_url / $send_url / $url string 请求目标 URL
$query array URL Query 参数(会以 ?a=1&b=2 拼接到 URL)
$postData array | string 请求体数据
$headers array 自定义 HTTP Header(字符串数组,格式 Key: value)
$timeout int 超时时间(秒),默认 30~60 秒

Get()


PostJson()

以 Content-Type: application/json 发送 POST 请求,$postData 数组会自动 json_encode(使用 JSON_UNESCAPED_UNICODE)。


PostForm()

以 application/x-www-form-urlencoded 发送表单 POST。


PostFile()

使用 multipart/form-data 上传文件,基于 PHP 原生 CURLFile。

示例:上传文件并携带额外字段


PostBinary()

发送二进制数据(例如图片字节流、protobuf)。返回结构包含响应、错误、HTTP 元信息。

返回值:


Put()

发送 PUT 请求,默认 JSON 编码。


Delete()

发送 DELETE 请求。


错误处理

所有请求在失败时均抛出 \Exception:


CommitAnalyzer - 提交信息分析器

本包内置基于 Conventional Commits 规范的提交分析器,可自动分析 Git 日志、生成版本号建议、CHANGELOG、以及包提交用的 Description。

直接使用(CLI)

输出包含:有效性统计、按类型/Scope分布图、无效提交提示、自动生成的包描述(Summary/Keywords/Highlights)、完整 CHANGELOG。


代码调用

支持的 Conventional Commits Type

type 说明
feat 新增功能
fix 修复 bug
docs 文档变更
style 代码风格(非功能)
refactor 重构
perf 性能优化
test 测试相关
build 构建系统
ci CI/CD 配置
chore 杂项维护
revert 回滚

示例提交:


目录结构


License

MIT License © tobycroft


All versions of net with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
ext-curl Version *
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tuuz/net contains the following files

Loading the files please wait ...