PHPackages                             peachpear/pear-web - 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. peachpear/pear-web

ActiveProject[Framework](/categories/framework)

peachpear/pear-web
==================

pear for web framework

1.0.5(6y ago)01MPL-2.0PHPPHP &gt;=7.0.0CI failing

Since Dec 21Pushed 5y ago1 watchersCompare

[ Source](https://github.com/peachpear/pear-web)[ Packagist](https://packagist.org/packages/peachpear/pear-web)[ RSS](/packages/peachpear-pear-web/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (3)Versions (6)Used By (0)

pear-web
========

[](#pear-web)

pear让你更畅快地编程。pear-web是以pear-api为基础，增加web必要服务，重构为提供web访问服务的框架。 支持PHP、MySQL、Redis、Kafka、RabbitMQ。

### 前提准备

[](#前提准备)

必要服务支持：Mysql、Nginx、php-fpm、Redis、Kafka、RabbitMQ

可选服务支持：Elasticsearch、Kibana、Jenkins

### 使用说明

[](#使用说明)

```
cd /yourProjectParentPath

composer create-project peachpear/pear-web yourProjectName

cd /path/yourProjectName/backend/config

ln -sf dev.php main.php

```

nginx 配置

```
server {
    charset utf-8;
    client_max_body_size 128M;

    listen 80; ## listen for ipv4
    #listen [::]:80 default_server ipv6only=on; ## listen for ipv6

    server_name yourServerName;
    root        /path/yourProjectName/backend/web;
    index       index.php;

    location / {
        # Redirect everything that isn't a real file to index.php
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ \.php$ {
        include fastcgi.conf;
        fastcgi_pass   127.0.0.1:9000;
        #fastcgi_pass unix:/var/run/php5-fpm.sock;
        try_files $uri =404;
    }

    #error_page 404 /404.html;

    location ~ /\.(ht|svn|git) {
        deny all;
    }
}

```

#### 目录结构

[](#目录结构)

```
├── backend
|   ├── components
|   ├── config
|   ├── controllers
|   └── lib
├── common
│   ├── components
│   ├── config
│   ├── dao
│   ├── exception
│   ├── lib
│   ├── misc
│   ├── models
│   └── service
└── console
    ├── components
    ├── config
    └── controllers

```

#### 编码规范

[](#编码规范)

```
1.PHP所有 关键字 必须 全部小写（常量 true 、false 和 null 也 必须 全部小写）
2.命名model对应的class 必须 以Model结尾
3.命名service对应的class 必须 以Service结尾
4.命名dao对应的class 必须 以Dao结尾
5.数据库查询返回接口 应该 使用model对象/对象列表
6.数据库的key必须是dbname+DB形式，e.g:dbname为test,则key为testDB
7.dao目录存放sql语句或者orm
8.model目录存放对应的数据实例对象
9.service目录存放业务逻辑处理

```

#### 用户表

[](#用户表)

```
-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` smallint(6) NOT NULL DEFAULT '30' COMMENT '用户类型：10、超级管理员；20：管理员；30：普通用户',
  `username` varchar(255) NOT NULL COMMENT '用户账户',
  `auth_key` varchar(32) NOT NULL COMMENT '认证key',
  `password_hash` varchar(255) NOT NULL COMMENT '密码',
  `password_reset_token` varchar(255) DEFAULT NULL,
  `nickname` varchar(255) NOT NULL COMMENT '用户姓名',
  `phone` varchar(24) NOT NULL DEFAULT '' COMMENT '用户手机号码',
  `email` varchar(255) NOT NULL DEFAULT '' COMMENT '用户邮箱',
  `status` smallint(6) NOT NULL DEFAULT '10' COMMENT '用户状态：10、正常；99：禁用',
  `created_time` int(11) NOT NULL COMMENT '添加时间',
  `created_user_id` int(11) NOT NULL DEFAULT '0' COMMENT '添加用户',
  `updated_time` int(11) NOT NULL COMMENT '更新时间',
  `updated_user_id` int(11) NOT NULL DEFAULT '0' COMMENT '更新用户',
  PRIMARY KEY (`id`),
  UNIQUE KEY `username` (`username`),
  UNIQUE KEY `password_reset_token` (`password_reset_token`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户表';

-- ----------------------------
-- Records of user   admin/admin
-- ----------------------------
INSERT INTO `user` VALUES ('1', '10', 'admin', 'mwrf34kLfW85FVN5X88166bulEhRkzQe', '$2y$13$LDJ4J0rX0YIQX/TcPPilqOzSQb.mhaPC7HjaTef9i0MfrLGwoUQny', null, '超级管理员', '1010', 'admin@demo.com', '10', '1541507292', '0', '1545362198', '1');

```

#### 配置中心

[](#配置中心)

配置中心的配置文件demo.json内容可如下：

```
{
  "demo-params":{
    "grab":[
      {
        "grab":{"domain":"http://test.service.demo.com"},
        "version":"2.0.2"
      },
      {
        "grab":{"domain":"http://dev.service.demo.com"},
        "version":"*"
      }
    ],
    "path":[
      {
        "path":"http://path.demo.com/",
        "version":"*"
      }
    ]
  },
  "mysql":{
    "master":[
      {
        "db":"demo",
        "host":"127.0.0.1",
        "password":"root",
        "port":3306,
        "username":"root",
        "version":"*"
      }
    ]
  },
  "redis":{
    "cache":[
      {
        "host":"127.0.0.1",
        "port":6379,
        "keyPrefix":"abc.",
        "version":"*"
      }
    ]
  },
  "kafka":{
    "master":[
      {
        "brokerList":[
          {
            "host":"127.0.0.1",
            "port":9092
          }
        ],
        "version":"*"
      }
    ]
  },
  "queue":{
    "master":[
      {
        "host":"127.0.0.1",
        "login":"mqadmin",
        "password":"mqadmin",
        "port":5672,
        "version":"*"
      }
    ]
  }
}

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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 ~118 days

Total

5

Last Release

2225d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/819a98d6510f153619bca993382ab14b56a861bdb371e60339aa9b98b9b20ace?d=identicon)[iBaiYang](/maintainers/iBaiYang)

---

Top Contributors

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

---

Tags

webPEARpeachpear

### Embed Badge

![Health badge](/badges/peachpear-pear-web/health.svg)

```
[![Health](https://phpackages.com/badges/peachpear-pear-web/health.svg)](https://phpackages.com/packages/peachpear-pear-web)
```

###  Alternatives

[twbs/bootstrap

The most popular front-end framework for developing responsive, mobile first projects on the web.

174.1k17.6M327](/packages/twbs-bootstrap)[twitter/bootstrap

The most popular front-end framework for developing responsive, mobile first projects on the web.

174.1k1.7M27](/packages/twitter-bootstrap)[hprose/hprose

It is a modern, lightweight, cross-language, cross-platform, object-oriented, high performance, remote dynamic communication middleware. It is not only easy to use, but powerful. You just need a little time to learn, then you can use it to easily construct cross language cross platform distributed application system.

2.1k215.3k37](/packages/hprose-hprose)[clue/framework-x

Framework X – the simple and fast micro framework for building reactive web applications that run anywhere.

936736.7k8](/packages/clue-framework-x)[atk4/ui

Agile UI - Web Component Framework written in PHP

454540.1k32](/packages/atk4-ui)[coreui/coreui

The most popular front-end framework for developing responsive, mobile-first projects on the web rewritten and maintain by the CoreUI Team

873111.6k4](/packages/coreui-coreui)

PHPackages © 2026

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