2017 © Pedro Peláez
 

project think

the new thinkphp framework

image

chinashuguo/think

the new thinkphp framework

  • Wednesday, June 27, 2018
  • by chinashuguo
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1263 Forks
  • 0 Open issues
  • 40 Versions
  • 0 % Grown

The README.md

ThinkPHP 5.1

ThinkPHP5.1对底层架构做了进一步的改进,减少依赖,其主要特性包括:, (*1)

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

ThinkPHP5的运行环境要求PHP5.6以上。, (*2)

目录结构

初始的目录结构如下:, (*3)

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                 命令行入口文件

可以使用php自带webserver快速测试 切换到根目录后,启动命令:php think run, (*4)

升级指导

原有下面系统类库的命名空间需要调整:, (*5)

  • think\App => think\facade\App (或者 App )
  • think\Cache => think\facade\Cache (或者 Cache )
  • think\Config => think\facade\Config (或者 Config )
  • think\Cookie => think\facade\Cookie (或者 Cookie )
  • think\Debug => think\facade\Debug (或者 Debug )
  • think\Hook => think\facade\Hook (或者 Hook )
  • think\Lang => think\facade\Lang (或者 Lang )
  • think\Log => think\facade\Log (或者 Log )
  • think\Request => think\facade\Request (或者 Request )
  • think\Response => think\facade\Reponse (或者 Reponse )
  • think\Route => think\facade\Route (或者 Route )
  • think\Session => think\facade\Session (或者 Session )
  • think\Url => think\facade\Url (或者 Url )

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

命名规范

ThinkPHP5遵循PSR-2命名规范和PSR-4自动加载规范,并且注意如下规范:, (*7)

目录和文件

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

函数和类、属性命名

  • 类的命名采用驼峰法,并且首字母大写,例如 UserUserType,默认不需要添加后缀,例如UserController应该直接命名为User
  • 函数的命名使用小写字母和下划线(小写字母开头)的方式,例如 get_client_ip
  • 方法的命名使用驼峰法,并且首字母小写,例如 getUserName
  • 属性的命名使用驼峰法,并且首字母小写,例如 tableNameinstance
  • 以双下划线“__”打头的函数或方法作为魔法方法,例如 __call__autoload

常量和配置

  • 常量以大写字母和下划线命名,例如 APP_PATHTHINK_PATH
  • 配置参数以小写字母和下划线命名,例如 url_route_onurl_convert

数据表和字段

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

参与开发

请参阅 ThinkPHP5 核心框架包。, (*8)

版权信息

ThinkPHP遵循Apache2开源协议发布,并提供免费使用。, (*9)

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

版权所有Copyright © 2006-2018 by ThinkPHP (http://thinkphp.cn), (*11)

All rights reserved。, (*12)

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

更多细节参阅 LICENSE.txt, (*14)

The Versions

27/06 2018

dev-master

9999999-dev http://chinashuguo.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

orm framework thinkphp

27/06 2018

5.1.x-dev

5.1.9999999.9999999-dev http://chinashuguo.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

orm framework thinkphp

27/06 2018

V5.1.18

5.1.18.0 http://chinashuguo.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

orm framework thinkphp

18/06 2018

v5.1.17

5.1.17.0 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

orm framework thinkphp

06/06 2018

v5.1.16

5.1.16.0 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

orm framework thinkphp

01/06 2018

v5.1.15

5.1.15.0 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

orm framework thinkphp

18/05 2018

v5.1.14

5.1.14.0 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

orm framework thinkphp

11/05 2018

v5.0.20

5.0.20.0 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

orm framework thinkphp

11/05 2018

v5.1.13

5.1.13.0 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

orm framework thinkphp

01/05 2018

5.2.x-dev

5.2.9999999.9999999-dev http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

orm framework thinkphp

25/04 2018

v5.0.19

5.0.19.0 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

orm framework thinkphp

25/04 2018

v5.1.12

5.1.12.0 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

orm framework thinkphp

19/04 2018

v5.1.11

5.1.11.0 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

orm framework thinkphp

14/04 2018

v5.1.10

5.1.10.0 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

orm framework thinkphp

14/04 2018

v5.0.18

5.0.18.0 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

orm framework thinkphp

05/04 2018

v5.1.8

5.1.8.0 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

orm framework thinkphp

26/03 2018

v5.1.6

5.1.6.0 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

orm framework thinkphp

26/03 2018

v5.0.16

5.0.16.0 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

orm framework thinkphp

31/01 2018

v5.1.5

5.1.5.0 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

orm framework thinkphp

31/01 2018

v5.0.15

5.0.15.0 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

orm framework thinkphp

01/01 2018

v5.0.14

5.0.14.0 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

orm framework thinkphp

31/12 2017

v5.1.0

5.1.0.0 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

orm framework thinkphp

12/12 2017

v5.0.13

5.0.13.0 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

orm framework thinkphp

23/10 2017

v5.0.12

5.0.12.0 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

orm framework thinkphp

23/10 2017

v5.1-rc.3

5.1.0.0-RC3 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

orm framework thinkphp

21/07 2017

v5.0.11

5.0.11.0 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

orm framework thinkphp

04/07 2017

v5.0.10

5.0.10.0 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

orm framework thinkphp

20/05 2017

v5.0.9

5.0.9.0 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

orm framework thinkphp

27/04 2017

v5.1-beta.1

5.1.0.0-beta1 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

orm framework thinkphp

20/03 2017

v5.0.8

5.0.8.0 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

orm framework thinkphp

24/02 2017

v5.0.7

5.0.7.0 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

orm framework thinkphp

03/02 2017

v5.0.6

5.0.6.0 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

orm framework thinkphp

17/01 2017

v5.0.5

5.0.5.0 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

orm framework thinkphp

11/11 2016

v5.0.3

5.0.3.0 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

orm framework thinkphp

11/11 2016

v5.0.4

5.0.4.0 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

orm framework thinkphp

24/10 2016

v5.0.2

5.0.2.0 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

orm framework thinkphp

23/09 2016

v5.0.1

5.0.1.0 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

orm framework thinkphp

16/09 2016

5.0

5.0.0.0 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

orm framework thinkphp

10/03 2016

5.0-rc2

5.0.0.0-RC2 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache2

The Requires

  • php >=5.4.0

 

The Development Requires

by liu21st

orm framework thinkphp

30/01 2016

5.0-rc1

5.0.0.0-RC1 http://thinkphp.cn/

the new thinkphp framework

  Sources   Download

Apache2

The Requires

  • php >=5.4.0

 

The Development Requires

by liu21st

orm framework thinkphp