PHPackages                             shiwei/tools - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. shiwei/tools

ActiveLibrary

shiwei/tools
============

我的工具类库

1.2.4(2mo ago)0328MITPHPPHP &gt;=7.0

Since Nov 4Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/xishiwei0821/tools)[ Packagist](https://packagist.org/packages/shiwei/tools)[ RSS](/packages/shiwei-tools/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (20)Used By (0)

工具类
---

[](#工具类)

#### 封装常用函数以及数据处理算法

[](#封装常用函数以及数据处理算法)

- Helper

需要引入类 Shiwei\\Tools\\Helper

方法名调用方式备注createNonceStr静态调用创建随机字符串createPathDir静态调用创建多级目录getFileType静态调用获取本地文件mini\_type类型downloadImage静态调用下载网络图片到指定目录compressImage静态调用根据最大宽高压缩图片getMicroTime静态调用获取13位微妙时间戳getAllProducts静态调用获取笛卡尔乘积函数getIndexTree静态调用根据指定key将数组转为索引函数getDateZone静态调用获取时间范围- Format

需要引入类 Shiwei\\Tools\\Format

方法名调用方式备注objectToArray静态调用将对象转为数组arrayToTree静态调用将数组转为tree结构，可以指定数据id和pidtimeToString静态调用将时间戳转为通用时间类型timeToElapsed静态调用将时间转为距离现在的时长 例如 x小时前timeToShow静态调用将时间转为可用显示时间 例如 昨天上午10:00strToPoint静态调用将字符串分段转数组fileToBase64静态调用文件转base64字符串xmlToArray静态调用xml转数组arrayToXml静态调用数组转xml- Redis

需要引入类 Shiwei\\Tools\\Redis

方法名调用方式备注set实例化key -&gt; value 类型数据存储get实例化key -&gt; value 类型数据获取key的值del实例化key -&gt; value 类型数据删除hashSet实例化hash表数据保存hashGet实例化hash表数据获取hashDel实例化hash表数据删除setSet实例化集合类型数据保存setGet实例化集合类型数据获取setDel实例化集合类型数据删除setRem实例化集合类型数据清空listPush实例化列表pushlistPop实例化列表pop- Request

需要引入类 Shiwei\\Tools\\Request

方法名调用方式备注fetch静态调用发送curl请求获取数据- Excel

需要引入类 Shiwei\\Tools\\Excel

方法名调用方式备注number2column静态调用将索引转列名column2number静态调用将列名转索引setOptions实例化设置参数getOptions实例化获取参数read实例化全量读取数据course\_handle实例化逐行读取数据write实例化根据设置格式写入数据

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance86

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~27 days

Recently: every ~9 days

Total

19

Last Release

67d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/88397485976e083a2ecdadcc1dcb7c3d1d7b9805e05adb117e25132bb796e8aa?d=identicon)[xishiwei](/maintainers/xishiwei)

---

Top Contributors

[![xishiwei0821](https://avatars.githubusercontent.com/u/59943799?v=4)](https://github.com/xishiwei0821 "xishiwei0821 (29 commits)")

---

Tags

tools

### Embed Badge

![Health badge](/badges/shiwei-tools/health.svg)

```
[![Health](https://phpackages.com/badges/shiwei-tools/health.svg)](https://phpackages.com/packages/shiwei-tools)
```

###  Alternatives

[vaimo/composer-patches

Applies a patch from a local or remote file to any package that is part of a given composer project. Patches can be defined both on project and on package level. Optional support for patch versioning, sequencing, custom patch applier configuration and patch command for testing/troubleshooting added patches.

2994.3M16](/packages/vaimo-composer-patches)[dereuromark/cakephp-tools

A CakePHP plugin containing lots of useful and reusable tools

338920.1k32](/packages/dereuromark-cakephp-tools)[essa/api-tool-kit

set of tools to build an api with laravel

52680.5k](/packages/essa-api-tool-kit)[php-mcp/laravel

Laravel SDK for building Model Context Protocol (MCP) servers - Seamlessly integrate MCP tools, resources, and prompts into Laravel applications

47283.1k1](/packages/php-mcp-laravel)[mxl/laravel-job

Laravel job tools

661.3M](/packages/mxl-laravel-job)[longman/ip-tools

PHP IP Tools for manipulation with IPv4 and IPv6

147245.6k6](/packages/longman-ip-tools)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
