PHPackages                             bot/bot-framework - 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. bot/bot-framework

ActiveLibrary[Framework](/categories/framework)

bot/bot-framework
=================

度秘bot开发的web框架

142PHP

Since Oct 22Pushed 7y ago1 watchersCompare

[ Source](https://github.com/gongqingliang821/bot-framework)[ Packagist](https://packagist.org/packages/bot/bot-framework)[ RSS](/packages/bot-bot-framework/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

bot-framework
=============

[](#bot-framework)

php封装的bot开发框架，主要功能如下：

- 基于php5.4以上版本开发
- 基于php的namespace机制实现的autoload
- 简易的orm框架，可支持mysql和sqlite（基于pdo\_mysql和pdo\_sqlite）
- 简易的mvc

安装
--

[](#安装)

```
composer require bot/bot-framework dev-master
```

生成数据库orm
--------

[](#生成数据库orm)

执行php vendor/bot/bot-framework/init.php 会生成config目录及index.php、install.php文件,在config/conf.php中,修改数据库配置

```
DB::init("mysql:host=xx.xx.xx.xx;dbname=xx;port=xx",'xx','xx');
```

然后执行php install.php生成数据表对应的文件

编写controller
------------

[](#编写controller)

在app下新建个controller目录,指定bot路由的controller,例如凯叔bot的control路由是KaishuController.php

配置nginx
-------

[](#配置nginx)

nginx配置index.php

使用redis
-------

[](#使用redis)

```
$redis = BotRedis::getInstance();
$redis->set('foo', 'bar');
$value = $redis->get('foo');

$redis->hset('hash1', 'key1', 'v1'); //将key为'key1' value为'v1'的元素存入hash1表
$value = $redis->hget('hash1', 'key1'); //取出表'hash1'中的key 'key1'的值,返回'v1'

$redis->rpush('fooList', 'bar1') ;  //列表填加一个元素
$value = $redis->lindex ('fooList', 1) ;  //返回指定元素'bar1'

$redis->sadd('set1', 'ab'); //sadd 增加元素,返回true
$value = $redis->spop('set1'); //弹出首元素
```

demo
----

[](#demo)

```
http://127.0.0.0:8704/kaishu
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity39

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/13067945?v=4)[gongqingliang](/maintainers/gongqingliang821)[@gongqingliang821](https://github.com/gongqingliang821)

---

Top Contributors

[![gongqingliang821](https://avatars.githubusercontent.com/u/13067945?v=4)](https://github.com/gongqingliang821 "gongqingliang821 (1 commits)")

### Embed Badge

![Health badge](/badges/bot-bot-framework/health.svg)

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

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M192](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

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

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)

PHPackages © 2026

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