PHPackages                             littlemo/tool - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. littlemo/tool

ActiveProject[Utility &amp; Helpers](/categories/utility)

littlemo/tool
=============

the littlemo common tools

v1.5.9(4y ago)2116Apache-2.0PHPPHP ^7.0

Since Jul 6Pushed 4y ago1 watchersCompare

[ Source](https://github.com/littlemolh/tool-php)[ Packagist](https://packagist.org/packages/littlemo/tool)[ RSS](/packages/littlemo-tool/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (10)Dependencies (3)Versions (43)Used By (0)

littlemo tool
=============

[](#littlemo-tool)

[![Total Downloads](https://camo.githubusercontent.com/a436254817c31447e05e2546804720758992eef56e75ec34a99108d74ef93761/68747470733a2f2f706f7365722e707567782e6f72672f6c6974746c656d6f2f746f6f6c2f646f776e6c6f616473)](https://packagist.org/packages/littlemo/tool)[![Latest Stable Version](https://camo.githubusercontent.com/73ffd7f91c4893a55281d416110704ccd81fb548ca09827df3f531cd5149d394/68747470733a2f2f706f7365722e707567782e6f72672f6c6974746c656d6f2f746f6f6c2f762f737461626c65)](https://packagist.org/packages/littlemo/tool)[![Latest Unstable Version](https://camo.githubusercontent.com/3d918992b5697d5f36901196be7a3cdd0b878bab8be84fa87f378daac5f41c10/68747470733a2f2f706f7365722e707567782e6f72672f6c6974746c656d6f2f746f6f6c2f762f756e737461626c65)](https://packagist.org/packages/littlemo/tool)[![PHP Version](https://camo.githubusercontent.com/facf49f38d3f6bf192c14ce71a5e2479a4641044e627d4b7a27e4298a3002704/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344372e322d3838393242462e737667)](http://www.php.net/)[![License](https://camo.githubusercontent.com/1af8919a4b771e3c944babc5096253c1ed34e72162fd93c7953b973f3d8209e9/68747470733a2f2f706f7365722e707567782e6f72672f6c6974746c656d6f2f746f6f6c2f6c6963656e7365)](https://packagist.org/packages/littlemo/tool)

### 介绍

[](#介绍)

php常用工具库

#### 软件架构

[](#软件架构)

基于ThinkPHP

### 安装教程

[](#安装教程)

composer.json

```
{
    "require": {
        "php": "^7.4",
        "littlemo/tool": "*"
    }
}
```

### 使用说明

[](#使用说明)

#### 统计单位时间内同一个IP请求次数

[](#统计单位时间内同一个ip请求次数)

> 需要安装`redis`扩展,并启动 `redis` 服务

##### 示例代码

[](#示例代码)

```
use littlemo\tool\RequestRate;
$config=[
    'prefix'=>'ip',//缓存前缀
    'time'=>'60',//单位时间（s）
    'maxCount'=>'30',//单位时间最大请求次数
    'cache'=>[
        'type' => 'redis',//缓存类型，目前仅支持redis
        'host' => '127.0.0.1',//缓存服务连接地址
        'port' => '6379',//缓存服务端口
        'select' => 0,//redis库号，一般取值范围（0-15）
    ]
]

//实例化对象
$requestRate = new RequestRate($config);

//获取错误信息
$error = $requestRate->$getMessage();

//初始化缓存服务,实例化对象时回自动初始化缓存服务
$requestRate->setCacheObj();

//验证器
$result = $requestRate->check();
if($result === false){
    echo $requestRate->$getMessage();
}else{
    echo '未达到请求次数上限';
}
```

#### 自动更新Git

[](#自动更新git)

> 仅支持gitee

##### 示例代码

[](#示例代码-1)

```
use littlemo\tool\Git;

$token = 'XXXXXXX';

//实例化对象
$Git = new Git($token);

//验证器
$error = $Git->check($token);

/**
* 拉取代码
* @param string $path   执行脚本相对路径；默认：'..'
* @param string $exec   执行脚本；默认：'git pull origin master'
*/
$Git->pull($path, $exec);
```

- 拉取代码的日志会直接在页面输出

#### 下载文件

[](#下载文件)

##### 示例代码

[](#示例代码-2)

```
use littlemo\tool\Download;

/**
* 下载文件
* @param string $file      文件路径（文件所在磁盘的绝对路径）
* @param string $filename  带后缀的文件名称
*/

Download::file($file, $filename);
```

### 参与贡献

[](#参与贡献)

1. littlemo

### 特技

[](#特技)

- 统一、精简

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.9% 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 ~3 days

Total

42

Last Release

1686d ago

PHP version history (4 changes)v1.0.0PHP &gt;=7.0

v1.1.0PHP &gt;=7.2

v1.1.1PHP &gt;=7.1

v1.3.2PHP ^7.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16798708?v=4)[25362583](/maintainers/25362583)[@25362583](https://github.com/25362583)

---

Top Contributors

[![25362583](https://avatars.githubusercontent.com/u/16798708?v=4)](https://github.com/25362583 "25362583 (87 commits)")[![littlemolh](https://avatars.githubusercontent.com/u/26665792?v=4)](https://github.com/littlemolh "littlemolh (1 commits)")

---

Tags

toolthinkphp

### Embed Badge

![Health badge](/badges/littlemo-tool/health.svg)

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

###  Alternatives

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

23.8k69.4k](/packages/grumpydictator-firefly-iii)[phing/phing

PHing Is Not GNU make; it's a PHP project build system or build tool based on Apache Ant.

1.2k22.2M901](/packages/phing-phing)[bamarni/composer-bin-plugin

No conflicts for your bin dependencies

52823.6M1.0k](/packages/bamarni-composer-bin-plugin)[bakerkretzmar/nova-settings-tool

A Laravel Nova tool to manage application settings.

164221.7k](/packages/bakerkretzmar-nova-settings-tool)[clagiordano/weblibs-configmanager

weblibs-configmanager is a tool library for easily read and access to php config array file and direct read/write configuration file / object

163.6M9](/packages/clagiordano-weblibs-configmanager)[liliuwei/thinkphp-jump

适用于thinkphp6.0的跳转扩展

2875.9k1](/packages/liliuwei-thinkphp-jump)

PHPackages © 2026

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