# ThinkPHP5.1.27_Update **Repository Path**: athelas/ThinkPHP5.1.27_Update ## Basic Information - **Project Name**: ThinkPHP5.1.27_Update - **Description**: 基于官方TP5.1.27版本(https://github.com/top-think/framework/tree/v5.1.27)持续维护,修复Bug,提高在PHP未来版本下的兼容性,并增加一些新特性。 - **Primary Language**: PHP - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 1 - **Created**: 2021-02-02 - **Last Updated**: 2024-05-31 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ![](http://www.thinkphp.cn/Uploads/editor/2016-06-23/576b4732a6e04.png) ThinkPHP 5.1(LTS) —— 12载初心,你值得信赖的PHP框架 =============== [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/top-think/framework/badges/quality-score.png?b=5.1)](https://scrutinizer-ci.com/g/top-think/framework/?branch=5.1) [![Build Status](https://travis-ci.org/top-think/framework.svg?branch=master)](https://travis-ci.org/top-think/framework) [![Total Downloads](https://poser.pugx.org/topthink/framework/downloads)](https://packagist.org/packages/topthink/framework) [![Latest Stable Version](https://poser.pugx.org/topthink/framework/v/stable)](https://packagist.org/packages/topthink/framework) [![PHP Version](https://img.shields.io/badge/php-%3E%3D5.6-8892BF.svg)](http://www.php.net/) [![License](https://poser.pugx.org/topthink/framework/license)](https://packagist.org/packages/topthink/framework) ThinkPHP5.1对底层架构做了进一步的改进,减少依赖,其主要特性包括: + 采用容器统一管理对象 + 支持Facade + 更易用的路由 + 注解路由支持 + 路由跨域请求支持 + 验证类增强 + 配置和路由目录独立 + 取消系统常量 + 类库别名机制 + 模型和数据库增强 + 依赖注入完善 + 支持PSR-3日志规范 + 中间件支持(`V5.1.6+`) + 支持`Swoole`/`Workerman`运行(`V5.1.18+`) 官方已经正式宣布`5.1.27`版本为LTS版本。 ### ChangeLog(非官方): + 2023-09-14 验证器新增自定义规则
**File: /library/think/Validate.php** >+ arrayFilter:normal/strict   过滤数组。normal-普通模式,有非空值即可通过;strict-严格模式,禁止存在空值。
+ 2023-05-22 新增自动部署脚本,用于解决通过Git钩子自动拉取时,文件权限被变更的问题
**Files: /deploy_files/Deploy.sh**
+ 2023-05-16 新增配置项“app.default_dir_permission”(INT),用于设置自动创建目录时,目录的权限
>+ convention.php >+ library/think/Build.php >+ library/think/File.php >+ library/think/cache/driver/File.php >+ library/think/console/command/Make.php >+ library/think/console/command/optimize/Autoload.php >+ library/think/console/command/optimize/Config.php >+ library/think/console/command/optimize/Schema.php >+ library/think/log/driver/File.php >+ library/think/template/driver/File.php
+ 2023-03-10 新增助手函数“获取缓存剩余时间”,并在Redis、File驱动中实现对应功能
**Files: /library/think/cache** >+ Driver.php   abstract public function ttl(string $name); >+ driver/File.php   public function ttl(string $name){} >+ driver/Lite.php   public function ttl(string $name){} >+ driver/Memcache.php   public function ttl(string $name){} >+ driver/Memcached.php   public function ttl(string $name){} >+ driver/Redis.php   public function ttl(string $name){} >+ driver/Sqlite.php   public function ttl(string $name){} >+ driver/Wincache.php   public function ttl(string $name){} >+ driver/Xcache.php   public function ttl(string $name){}
+ 2023-03-08 在数据库查询类中增加“关闭数据库连接”的方法
**File: /library/think/db/Query.php** > Db::close();
+ 2021-10-13 验证器新增自定义规则
**File: /library/think/Validate.php** >+ lengthByte:num1,num2   验证字符串字节长度。 >+ minByte:num   验证字符串最小字节长度。 >+ maxByte:num1   验证字符串最大字节长度。
+ 2021-04-25 验证器新增自定义规则
**File: /library/think/Validate.php** >+ notInTable:table,field   验证值是否不在于指定表字段中。基于inTable()的功能扩展。
+ 2021-03-30 验证器新增自定义规则
**File: /library/think/Validate.php** >+ isJson   验证是否是有效的JSON
+ 2021-03-11 验证器新增自定义规则
**File: /library/think/Validate.php** >+ inTable:table,field   验证值是否在于指定表字段中。基于unique()的功能扩展。 >+ requireIn:fieldA,list[0],list[1]...list[n]   当A字段的值在列表中时,B字段为必填
+ 2021-02-02 美化dump()函数,自定义样式
**File: /library/think/Debug.php** > public function dump()
+ 2021-02-02 修复不自动加载默认语言包的Bug
**File: /library/think/Lang.php** > public function detect()
+ 2021-02-02 修复一处过时的语法:字符串中取一位字母,不再使用$str{0},改为$str[0]
**File: /library/think/db/Query.php** > public function getPartitionTableName()
### 废除的功能: + 聚合模型 + 内置控制器扩展类 + 模型自动验证 > ThinkPHP5.1的运行环境要求PHP5.6+。 ## 安装 使用composer安装 ~~~ composer create-project topthink/think tp ~~~ 启动服务 ~~~ cd tp php think run ~~~ 然后就可以在浏览器中访问 ~~~ http://localhost:8000 ~~~ 更新框架 ~~~ composer update topthink/framework ~~~ ## 在线手册 + [完全开发手册](https://www.kancloud.cn/manual/thinkphp5_1/content) + [升级指导](https://www.kancloud.cn/manual/thinkphp5_1/354155) ## 命名规范 `ThinkPHP5.1`遵循PSR-2命名规范和PSR-4自动加载规范。 ## 参与开发 请参阅 [ThinkPHP5 核心框架包](https://github.com/top-think/framework)。 ## 版权信息 ThinkPHP遵循Apache2开源协议发布,并提供免费使用。 本项目包含的第三方源码和二进制文件之版权信息另行标注。 版权所有Copyright © 2006-2018 by ThinkPHP (http://thinkphp.cn) All rights reserved。 ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。 更多细节参阅 [LICENSE.txt](LICENSE.txt)