PHPackages                             lg/tpthink - 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. [Admin Panels](/categories/admin)
4. /
5. lg/tpthink

ActiveProject[Admin Panels](/categories/admin)

lg/tpthink
==========

the new xiaolizi adminframework

06PHP

Since Mar 22Pushed 8y agoCompare

[ Source](https://github.com/gaoboxl/tp51)[ Packagist](https://packagist.org/packages/lg/tpthink)[ RSS](/packages/lg-tpthink/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

ThinkPHP 5.1
============

[](#thinkphp-51)

ThinkPHP5.1对底层架构做了进一步的改进，减少依赖，其主要特性包括：

- 采用容器统一管理对象
- 支持Facade
- 注解路由支持
- 路由跨域请求支持
- 配置和路由目录独立
- 取消系统常量
- 助手函数增强
- 类库别名机制
- 增加条件查询
- 改进查询机制
- 配置采用二级
- 依赖注入完善

> ThinkPHP5的运行环境要求PHP5.6以上。

目录结构
----

[](#目录结构)

初始的目录结构如下：

```
www  WEB部署目录（或者子目录）
├─application           应用目录
│  ├─common             公共模块目录（可以更改）
│  ├─module_name        模块目录
│  │  ├─common.php      模块函数文件
│  │  ├─controller      控制器目录
│  │  ├─model           模型目录
│  │  ├─view            视图目录
│  │  └─ ...            更多类库目录
│  │
│  ├─command.php        命令行定义文件
│  ├─common.php         公共函数文件
│  └─tags.php           应用行为扩展定义文件
│
├─config                应用配置目录
│  ├─module_name        模块配置目录
│  │  ├─database.php    数据库配置
│  │  ├─cache           缓存配置
│  │  └─ ...
│  │
│  ├─app.php            应用配置
│  ├─cache.php          缓存配置
│  ├─cookie.php         Cookie配置
│  ├─database.php       数据库配置
│  ├─log.php            日志配置
│  ├─session.php        Session配置
│  ├─template.php       模板引擎配置
│  └─trace.php          Trace配置
│
├─route                 路由定义目录
│  ├─route.php          路由定义
│  └─...                更多
│
├─public                WEB目录（对外访问目录）
│  ├─index.php          入口文件
│  ├─router.php         快速测试文件
│  └─.htaccess          用于apache的重写
│
├─thinkphp              框架系统目录
│  ├─lang               语言文件目录
│  ├─library            框架类库目录
│  │  ├─think           Think类库包目录
│  │  └─traits          系统Trait目录
│  │
│  ├─tpl                系统模板目录
│  ├─base.php           基础定义文件
│  ├─console.php        控制台入口文件
│  ├─convention.php     框架惯例配置文件
│  ├─helper.php         助手函数文件
│  ├─phpunit.xml        phpunit配置文件
│  └─start.php          框架入口文件
│
├─extend                扩展类库目录
├─runtime               应用的运行时目录（可写，可定制）
├─vendor                第三方类库目录（Composer依赖库）
├─build.php             自动生成定义文件（参考）
├─composer.json         composer 定义文件
├─LICENSE.txt           授权说明文件
├─README.md             README 文件
├─think                 命令行入口文件

```

> router.php用于php自带webserver支持，可用于快速测试 切换到public目录后，启动命令：php -S localhost:8888 router.php 上面的目录结构和名称是可以改变的，这取决于你的入口文件和配置参数。

升级指导
----

[](#升级指导)

原有下面系统类库的命名空间需要调整：

- think\\App =&gt; think\\facade\\App （或者 App ）
- think\\Cache =&gt; think\\facade\\Cache （或者 Cache ）
- think\\Config =&gt; think\\facade\\Config （或者 Config ）
- think\\Cookie =&gt; think\\facade\\Cookie （或者 Cookie ）
- think\\Debug =&gt; think\\facade\\Debug （或者 Debug ）
- think\\Hook =&gt; think\\facade\\Hook （或者 Hook ）
- think\\Lang =&gt; think\\facade\\Lang （或者 Lang ）
- think\\Log =&gt; think\\facade\\Log （或者 Log ）
- think\\Request =&gt; think\\facade\\Request （或者 Request ）
- think\\Response =&gt; think\\facade\\Reponse （或者 Reponse ）
- think\\Route =&gt; think\\facade\\Route （或者 Route ）
- think\\Session =&gt; think\\facade\\Session （或者 Session ）
- think\\Url =&gt; think\\facade\\Url （或者 Url ）

原有的配置文件config.php 拆分为app.php cache.php 等独立配置文件 放入config目录。 原有的路由定义文件route.php 移动到route目录

命名规范
----

[](#命名规范)

`ThinkPHP5`遵循PSR-2命名规范和PSR-4自动加载规范，并且注意如下规范：

### 目录和文件

[](#目录和文件)

- 目录不强制规范，驼峰和小写+下划线模式均支持；
- 类库、函数文件统一以`.php`为后缀；
- 类的文件名均以命名空间定义，并且命名空间的路径和类库文件所在路径一致；
- 类名和类文件名保持一致，统一采用驼峰法命名（首字母大写）；

### 函数和类、属性命名

[](#函数和类属性命名)

- 类的命名采用驼峰法，并且首字母大写，例如 `User`、`UserType`，默认不需要添加后缀，例如`UserController`应该直接命名为`User`；
- 函数的命名使用小写字母和下划线（小写字母开头）的方式，例如 `get_client_ip`；
- 方法的命名使用驼峰法，并且首字母小写，例如 `getUserName`；
- 属性的命名使用驼峰法，并且首字母小写，例如 `tableName`、`instance`；
- 以双下划线“\_\_”打头的函数或方法作为魔法方法，例如 `__call` 和 `__autoload`；

### 常量和配置

[](#常量和配置)

- 常量以大写字母和下划线命名，例如 `APP_PATH`和 `THINK_PATH`；
- 配置参数以小写字母和下划线命名，例如 `url_route_on` 和`url_convert`；

### 数据表和字段

[](#数据表和字段)

- 数据表和字段采用小写加下划线方式命名，并注意字段名不要以下划线开头，例如 `think_user` 表和 `user_name`字段，不建议使用驼峰和中文作为数据表字段命名。

参与开发
----

[](#参与开发)

请参阅 [ThinkPHP5 核心框架包](https://github.com/top-think/framework)。

版权信息
----

[](#版权信息)

ThinkPHP遵循Apache2开源协议发布，并提供免费使用。

本项目包含的第三方源码和二进制文件之版权信息另行标注。

版权所有Copyright © 2006-2018 by ThinkPHP ()

All rights reserved。

ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。

更多细节参阅 [LICENSE.txt](LICENSE.txt)

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/4a06732324849c2bcb34b14370729bfab37c705303bbf1bbbe1cbd38baa483ff?d=identicon)[xiaolizi1972](/maintainers/xiaolizi1972)

---

Top Contributors

[![xiaolizi1972](https://avatars.githubusercontent.com/u/29084297?v=4)](https://github.com/xiaolizi1972 "xiaolizi1972 (5 commits)")

### Embed Badge

![Health badge](/badges/lg-tpthink/health.svg)

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

###  Alternatives

[jeroennoten/laravel-adminlte

Easy AdminLTE integration with Laravel

4.0k4.8M43](/packages/jeroennoten-laravel-adminlte)[dmstr/yii2-adminlte-asset

AdminLTE backend theme asset bundle for Yii 2.0 Framework

1.1k1.8M67](/packages/dmstr-yii2-adminlte-asset)[dwij/laraadmin

LaraAdmin is a Open source Laravel Admin Panel / CMS which can be used as Admin Backend, Data Management Tool or CRM boilerplate for Laravel with features like CRUD Generation, Module Manager, Media, Menus, Backups and much more

1.6k68.7k](/packages/dwij-laraadmin)[filament/spatie-laravel-media-library-plugin

Filament support for `spatie/laravel-medialibrary`.

1764.8M125](/packages/filament-spatie-laravel-media-library-plugin)[bezhansalleh/filament-exceptions

A Simple &amp; Beautiful Pluggable Exception Viewer for FilamentPHP's Admin Panel

193195.9k13](/packages/bezhansalleh-filament-exceptions)[filament/infolists

Easily add beautiful read-only infolists to any Livewire component.

1220.8M36](/packages/filament-infolists)

PHPackages © 2026

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