PHPackages                             hutcms/hutphp - 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. [Framework](/categories/framework)
4. /
5. hutcms/hutphp

ActiveLibrary[Framework](/categories/framework)

hutcms/hutphp
=============

04PHP

Since Apr 27Pushed 4y agoCompare

[ Source](https://github.com/lishelun/hutphp)[ Packagist](https://packagist.org/packages/hutcms/hutphp)[ RSS](/packages/hutcms-hutphp/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

HUTPHP
======

[](#hutphp)

**ThinkPHP V6.0 Development Library**

**基于** [Anyon](https://gitee.com/zoujingli) / [ThinkLibrary](https://gitee.com/zoujingli/ThinkLibrary) **精简改造**

控制器
---

[](#控制器)

```

```

模板
--

[](#模板)

```
$this->fetch($templage,$vars)
$this->assign($name,$value);
$this->assign(['name1'=>'val1','name2'=>'val2']);
```

查询
--

[](#查询)

```
$this->query('tableName')->where("id",'1')->select();
$this->query('tableName')->page_fetch();
$this->query('tableName')->like('table_filed_id#param_id,name#name')
$this->query('tableName')->equal('table_filed_id#param_id,name#name');
$this->query('tableName')->list('order','page','limit');
$this->query('tableName')->equal('table_filed_id#param_id');
$this->query('tableName')->valueBetween('id#param_id');
$this->query('tableName')->dateBetween('datetime#param_datetime');
$this->query('tableName')->timeBetween('newstime#param_newstime');
```

表单
--

[](#表单)

```
$this->_vali();

// 表单显示及数据更新
$this->_form($query, $template, $pk , $where, $data);
//表单回调
[_ACTION]_form_filter(array &$data)
[_ACTION]_form_result(bool $result, array $data)

// 数据删除处理
$this->_deleted($query);

// 数据禁用处理
$this->_save($query, ['status'=>'0']);
// 数据启用处理
$this->_save($query, ['status'=>'1']);
```

文件
--

[](#文件)

文件存储支持**本地服务器存储,七牛云存储管理,阿里云OSS存储,腾讯云COS存储**。

> - 文件存储默认使用文件`hash`命名，同一个文件只会存储一份；
> - 支持文件秒传，当文件已经上传到服务之后，再次上传同一个文件时将立即成功；
> - 支持以日期+随机的方式命名，注意此方法不支持秒传功能；
> - 所有文件上传之后，将统一返回`url`可访问的链接地址，直接存储到内容即可访问；
> - 更多文件规则可以在系统后台文件管理处配置参数，不同的存储方式配置不同的参数；

```
use hutphp\Storage;

$content = '文件内容';
$filename = '文件名称（支持路径）';
$location = '文件远程链接，如：https://www.baidu.com/favicon.ico';

$result = Storage::instance()->set($filename, $content); // 上传文件
$result = Storage::instance()->get($filename); // 读取文件
$result = Storage::instance()->del($filename); // 删除文件
$result = Storage::instance()->has($filename); // 判断是否存在
$result = Storage::instance()->url($filename); // 生成文件链接
$result = Storage::instance()->info($filename); // 获取文件参数
$result = Storage::instance()->down($location); // 下载远程文件到本地
```

关于参数`safe`为存储文件到安全目录，不允许直接使用`url`访问，主要用于上传一些私有文件。

**当然也可以指定存储引擎操作文件**：

```
// 本地服务器文件操作
use hutphp\storage\LocalStorage;

$result = LocalStorage::instance()->set($filename, $content, $safe); // 上传文件
$result = LocalStorage::instance()->get($filename, $safe); // 读取文件
$result = LocalStorage::instance()->del($filename, $safe); // 删除文件
$result = LocalStorage::instance()->has($filename, $safe); // 判断是否存在
$result = LocalStorage::instance()->url($filename, $safe); // 生成文件链接
$result = LocalStorage::instance()->info($filename, $safe); // 获取文件参数
$result = LocalStorage::instance()->down($url); // 下载远程文件到本地

// 阿里云 OSS 存储
use hutphp\storage\AliossStorage;

$result = AliossStorage::instance()->set($filename, $content); // 上传文件
$result = AliossStorage::instance()->get($filename); // 读取文件
$result = AliossStorage::instance()->del($filename); // 删除文件
$result = AliossStorage::instance()->has($filename); // 判断是否存在
$result = AliossStorage::instance()->url($filename); // 生成文件链接
$result = AliossStorage::instance()->info($filename); // 获取文件参数

// 腾讯云 COS 存储
use hutphp\storage\TxcosStorage;

$result = TxcosStorage::instance()->set($filename, $content); // 上传文件
$result = TxcosStorage::instance()->get($filename); // 读取文件
$result = TxcosStorage::instance()->del($filename); // 删除文件
$result = TxcosStorage::instance()->has($filename); // 判断是否存在
$result = TxcosStorage::instance()->url($filename); // 生成文件链接
$result = TxcosStorage::instance()->info($filename); // 获取文件参数

// 七牛云存储
use hutphp\storage\QiniuStorage;

$result = QiniuStorage::instance()->set($filename, $content); // 上传文件
$result = QiniuStorage::instance()->get($filename); // 读取文件
$result = QiniuStorage::instance()->del($filename); // 删除文件
$result = QiniuStorage::instance()->has($filename); // 判断是否存在
$result = QiniuStorage::instance()->url($filename); // 生成文件链接
$result = QiniuStorage::instance()->info($filename); // 获取文件参数
```

也可以使用助手函数

```
storage()->get($filename); //默认配置读取文件
storage('local')->get($filename); //本地存储读取文件
storage('alioss')->get($filename); //本地存储读取文件
storage('txcos')->get($filename); //本地存储读取文件
storage('qiniu')->get($filename); //本地存储读取文件
```

JWT
---

[](#jwt)

```
use hutphp\extend\JWTHelper

//编码
JWTHelper::instance()->encode(array $data,int $exp = 86400);//:string
//解码
JWTHelper::instance()->decode($jwtToken);//:object|bool
```

Table
-----

[](#table)

```
use hutphp\helper\TableHelper;
//初始化表助手
$table=TableHelper::instance()->init('SomeTableName');
//创建表
$table->createTable('id',true);
//删除表
$table->removeTable();
//清空表
$table->clearTable(auto_increment: int=1);
//优化表
$table->optimizeTable();
//添加字段
$table->addColumn(name,type,length,isnull,defaultval,auto_increment,unsigned,comment,after,charset,order,binary);
//删除字段
$table->removeColumn(name);
//修改字段
$table->changeColumn(name,new_name ,type,length,isnull,defaultval,auto_increment,unsigned,comment,after,charset,order,binary);
//添加索引
$table->addIndex('field'/*or [field1,field2]*/);
//删除索引
$table->removeIndex(index_name);
```

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity26

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

[![lishelun](https://avatars.githubusercontent.com/u/13258880?v=4)](https://github.com/lishelun "lishelun (28 commits)")

### Embed Badge

![Health badge](/badges/hutcms-hutphp/health.svg)

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

###  Alternatives

[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k39.6M298](/packages/laravel-dusk)[nineinchnick/edatatables

Grid widget for the Yii Framework, wrapper for the DataTables jQuery plugin

173.2k](/packages/nineinchnick-edatatables)[link-cloud/fast-hyperf

LinkCloud Fast Hyperf

241.2k1](/packages/link-cloud-fast-hyperf)

PHPackages © 2026

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