PHPackages                             sen-cao-king/one-php-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. sen-cao-king/one-php-framework

ActiveProject[Framework](/categories/framework)

sen-cao-king/one-php-framework
==============================

Simple and lightweight PHP framework

12PHP

Since Jan 11Pushed 7y agoCompare

[ Source](https://github.com/SenCaoKing/OnePHP-Framework)[ Packagist](https://packagist.org/packages/sen-cao-king/one-php-framework)[ RSS](/packages/sen-cao-king-one-php-framework/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

OnePHP-Framework
================

[](#onephp-framework)

简述
--

[](#简述)

**OnePHP**是一款简单的PHP MVC框架。

\[开发记录\]

### 要求

[](#要求)

- PHP 5.4.0+

- 目录准备(2018/06/08)

```
project              根目录
|--app               应用目录
|  |--controllers    控制器目录
|  |--models         模块目录
|  |--views          视图目录
|--config            配置文件目录
|--onephp            框架核心目录
|  |--base           MVC基类目录
|  |--db             数据库操作类目录
|  |--Onephp.php     内核文件
|--runtime           运行目录
|  |--caches         缓存文目录
|  |--logs           日志目录
|  |--sessions       缓存目录
|--static            静态文件目录
|--index.php         入口文件

```

使用
--

[](#使用)

### 1.克隆代码

[](#1克隆代码)

```
git clone https://github.com/SenCaoKing/OnePHP-Framework

```

### 2.创建数据库

[](#2创建数据库)

创建名为 todo 的数据库，并插入两条记录，命令：

```
CREATE DATABASE IF NOT EXISTS `todo`;
    USE `todo`;

    DROP TABLE IF EXISTS `item`;
    CREATE TABLE `item`  (
      `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
      `item_name` varchar(255) NOT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE = MyISAM AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8;

    INSERT INTO `item` VALUES (1, 'Hello World.');
    INSERT INTO `item` VALUES (2, 'Lets go!');

```

### 3.修改配置文件

[](#3修改配置文件)

打开配置文件 config/config.php ，使之与自己的数据库匹配

```
$config['db']['host'] = 'localhost';
$config['db']['username'] = 'root';
$config['db']['password'] = 'root';
$config['db']['dbname'] = 'todo';

```

### 4.配置Nginx或Apache

[](#4配置nginx或apache)

在Apache或Nginx中创建一个站点，把 project 设置为站点根目录（入口文件 index.php 所在的目录）。

然后设置单一入口，Apache服务器配置：

```

    # 打开Rewrite功能
    RewriteEngine On

    # 如果请求的是真实存在的文件或目录，直接访问
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    # 如果访问的文件或目录不是真实存在，分发请求至 index.php
    RewriteRule . index.php

```

Nginx服务器配置:

```
location / {
    # 重新向所有非真实存在的请求到index.php
    try_files $uri $uri/ /index.php$args;
}

```

### 5.测试访问

[](#5测试访问)

然后访问站点域名： 就可以了。

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

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

---

Top Contributors

[![SenCaoKing](https://avatars.githubusercontent.com/u/22975931?v=4)](https://github.com/SenCaoKing "SenCaoKing (71 commits)")

### Embed Badge

![Health badge](/badges/sen-cao-king-one-php-framework/health.svg)

```
[![Health](https://phpackages.com/badges/sen-cao-king-one-php-framework/health.svg)](https://phpackages.com/packages/sen-cao-king-one-php-framework)
```

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k104.3M844](/packages/laravel-socialite)[laravel/dusk

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

1.9k38.6M289](/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)
