PHPackages                             duiying/pandora - 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. duiying/pandora

ActiveProject

duiying/pandora
===============

自定义的组件化PHP框架

05PHP

Since Sep 2Pushed 6y ago1 watchersCompare

[ Source](https://github.com/duiying/Pandora)[ Packagist](https://packagist.org/packages/duiying/pandora)[ RSS](/packages/duiying-pandora/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

 Pandora
=========

[](#-pandora-)

自定义的组件化PHP框架

### 框架目录

[](#框架目录)

```
Pandora
|----app                                应用目录
|--------console                        后台应用目录
|--------web                            WEB应用目录
|------------controllers                控制器目录
|------------models                     模型类目录
|----config                             配置文件目录
|--------config.php                     框架配置文件
|----framework                          框架核心目录
|--------base                           框架基础目录
|------------Application.php            基础应用类
|------------Component.php              基础组件类
|------------Controller.php             基础控制器
|------------Model.php                  基础模型类
|--------component                      组件目录
|--------console                        框架后台目录
|--------web                            框架WEB目录
|------------Application.php            WEB应用类
|------------Controller.php             WEB控制器
|--------Pandora.php                    框架核心类
|----public                             框架入口目录
|--------web                            WEB入口目录
|----runtime                            runtime
|--------cache                          缓存文件目录
|------------index.php                  入口文件

```

### 组件

[](#组件)

```
MySQL组件
文件缓存组件

```

### 安装

[](#安装)

安装

```
git clone git@github.com:duiying/Pandora.git
cd Pandora
composer update
```

数据库配置 config/config.php

```
-- 新建数据库
CREATE DATABASE IF NOT EXISTS `pandora`;

-- 选择数据库
USE `pandora`;

-- 新建测试数据表
CREATE TABLE IF NOT EXISTS `user` (
    id INT(11) NOT NULL AUTO_INCREMENT,
    name VARCHAR(50),
    age INT(11),
    PRIMARY KEY(id)
);

-- 插入测试数据
INSERT INTO `user` (name, age) VALUES('duiying', 23), ('wangyaxian', 23);
```

### 规范

[](#规范)

目录规范

```
1. web目录存放WEB相关代码，console目录存放后台脚本相关代码

```

代码规范

```
1. 变量名采用驼峰式命名方式
2. 类名首字母大写

```

### 执行流程分析

[](#执行流程分析)

WEB

```
1. 入口文件：public/web/index.php。
2. index.php中执行\pandora\web\Application中的run方法，\pandora\web\Application继承\pandora\base\Application。
3. \pandora\base\Application中的run方法首先初始化框架核心类(读取配置)，然后调用handle方法处理请求。
4. \pandora\web\Application中的handle方法分发路由。

```

### 如何引入并使用组件

[](#如何引入并使用组件)

```
1. 在config/config.php文件中定义了组件信息，包括组件的类名和属性。
2. 使用Pandora::component('组件名称')的方式使用组件，此时\pandora\Pandora.php中的component方法会读取组件信息并返回组件的对象。

```

### ORM的实现思路

[](#orm的实现思路)

```
1. 基础模型类：\pandora\base\Model.php，自定义的模型类比如\app\web\models\User.php继承基础模型类。
2. 通过PDO查出相关记录，并通过基础模型类下的arr2Model方法转为Model。

```

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity36

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://www.gravatar.com/avatar/30bfc87ee117893719ee4548d1f544ad1231da7be3ea9397cced5ae797585dd8?d=identicon)[duiying](/maintainers/duiying)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/duiying-pandora/health.svg)

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

PHPackages © 2026

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