search
HomeBackend DevelopmentPHP Tutorial如何评价thinkphp5.0?

偶然发现thinkphp官方网站发布了thinkphp5.0的beta版本,但是我没找到官方文档,不知有谁用过或者看过源代码的觉得怎么样?

回复内容:

终于有单元测试了,值得肯定
既然重写了,都拥抱了psr-4了,psr-7也可以考虑一下
Loader.php可以写到composer.json里面autoload,这样只要require 'vendor/autoload.php'就一起自动加载了

读了一下代码,基础的抽象和封装仍然是错误的,例如Model.php。

总结,工程方面有所改进,技术方面仍然没进步。 ThinkPHP5 重新颠覆了之前的版本。

1.支持 Composer,PHPunit(中大型项目必备的依赖管理和测试框架)
2.使用同 yii2 一样的类惰性加载(性能暴升)
3.大量参考了 Laravel 风格,还保证了以往 ThinkPHP 简单易学(优雅并且易学)
4.引入了 php5.4 特性 Traits 拓展(多重继承,以前的关联模型,视图模型混合一起用)
5.终于遵循 PSR 规范了!终于遵循 PSR 规范了!终于遵循 PSR 规范了!
符合PSR-4的自动加载规范(专门写给CI党:PSR-4 是命名空间的自动加载规范哦)
6.以前单字母全局函数改成了别名函数(M,D,S,C等,除了易学好用还不会污染全局)
7.兼容 php 7,局部兼容 hhvm
=========================
目前 tp5 已经发布了 RC2 版,已经可以稳定可靠的为你的项目提供支持了
官方文档:[ ThinkPHP5.0完全开发手册 ]
=========================
2016年4月23日更
1.tp5 发布了 RC3 版,重构了 Model 类(跟 Laravel 很像)
2.重构了自动验证,现在的自动验证独立为验证器功能,支持场景等新特性。
3.废弃了单字母函数,是的。M,D 你再也找不到了,3.2.3 想无痛升级不太可能了。但是你可以通过 helper.php 文件自己命名 M,D 的别名函数
4.获取器,修改器,类型自动转换等等就不细说了

。。。。。。。。。。。。。。。。
回复一下,tp5 太像 laravel,不需要“山寨” laravel 之类的言论
tp5 确实某种程度上模仿了 laravel,但是,并没有任何抄袭。让好用的东西更好用,让更多的地方符合中国开发者的习惯,对于新手来讲,无论是学习曲线还是开发效率都比这些繁琐臃肿的框架来的实在
。。。。。。。。。。。。。。。。

ThikPHP 5 官方讨论 QQ 群:50546480(怕用 v5 自己一个人 hold 不住的快来吧,这有一群战友)

那些还在用 3.2.3 版本的 ThinkPHP 赶紧升级,大量的 php 的新特性会让你发现新的世界,ThinkPHP 5支持 php7,推荐使用 5.6 版本,最低兼容 5.4

如果你还在使用 php5.3 环境的 ThinkPHP3.2.3,那么你直接换到 php5.6 的 ThinkPHP5 会让你性能直接翻一倍,换到 php7 性能再翻一倍

温馨提示,apache 从 php5.2/3 换到 php5.6 有坑请注意,nginx 很顺利。 这段时间没用tp了,不过我想tp5.0应该会秉承一如既往的易用,易学,符合国人思维的特点吧。然后看手册里边,现在采用了惰式加载(也就是用到什么依赖就加载什么依赖,不用就不加载)的设计模式,这样能显著的提高应用的执行速度,从而提高了性能。其次增加了调试日志和信息,对开发者更友好。
总的来说,进步不小,不过我期待的利用composer来管理依赖的方式还是没有引进。 有人说thinkphp 5很像Laravel,然则它只是有点形似laravel,完全不神似。laravel的核心是什么?是一个IoC容器,然而tp5根本没有实现这些模式,所以只能形似。 刚知道出了TP5,就拉了源码粗略地扫了一下。TP5开始有点接入正轨了,比如使用composer、psr4、phpunit、php_codesniffer等,但是源码多处地方却违反了引入composer的初衷(原因是,TP现在还没有把所有组件给单独出来,这是历史遗留问题)。

等会再补,TP5也有有点。

不管是什么框架,不论好坏,在国内,如果有TP这样的愿意分享的社区,我都支持。 还是表明占位的态度吧,在用,可能是文档还在完善中吧,许多方法只能查源码,对于一个框架产品使用者而言,暂未发现相较于3.2的惊喜之处。 TP5.0发布必然会导致laravel党各种不适,哈哈,开个玩笑,关于tp作者流年能虚心参考laravel框架设计先给个大赞,tp是一款国内公认的好入门、开发效率高、各种贴心的php框架,对于这个5.0版本暂时处于观望中,新项目或许采用,首先声明我也是laravel忠实用户,用laravel框架也做过不少项目,综合评估两者之间各有优缺点,勿喷。 THINKPHP一直是我比较看好的框架,从thinkphp1.0到现在3.2.3,可以说每个版本都在进步,5.0我还没看过代码,不过,我很期待。 国内做php的小公司基本都用thinkphp 了,我也用过2年,最后换到CI了,
到但是 祝他发展顺风顺水! 谢邀,没用过它
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
The Continued Use of PHP: Reasons for Its EnduranceThe Continued Use of PHP: Reasons for Its EnduranceApr 19, 2025 am 12:23 AM

What’s still popular is the ease of use, flexibility and a strong ecosystem. 1) Ease of use and simple syntax make it the first choice for beginners. 2) Closely integrated with web development, excellent interaction with HTTP requests and database. 3) The huge ecosystem provides a wealth of tools and libraries. 4) Active community and open source nature adapts them to new needs and technology trends.

PHP and Python: Exploring Their Similarities and DifferencesPHP and Python: Exploring Their Similarities and DifferencesApr 19, 2025 am 12:21 AM

PHP and Python are both high-level programming languages ​​that are widely used in web development, data processing and automation tasks. 1.PHP is often used to build dynamic websites and content management systems, while Python is often used to build web frameworks and data science. 2.PHP uses echo to output content, Python uses print. 3. Both support object-oriented programming, but the syntax and keywords are different. 4. PHP supports weak type conversion, while Python is more stringent. 5. PHP performance optimization includes using OPcache and asynchronous programming, while Python uses cProfile and asynchronous programming.

PHP and Python: Different Paradigms ExplainedPHP and Python: Different Paradigms ExplainedApr 18, 2025 am 12:26 AM

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

PHP and Python: A Deep Dive into Their HistoryPHP and Python: A Deep Dive into Their HistoryApr 18, 2025 am 12:25 AM

PHP originated in 1994 and was developed by RasmusLerdorf. It was originally used to track website visitors and gradually evolved into a server-side scripting language and was widely used in web development. Python was developed by Guidovan Rossum in the late 1980s and was first released in 1991. It emphasizes code readability and simplicity, and is suitable for scientific computing, data analysis and other fields.

Choosing Between PHP and Python: A GuideChoosing Between PHP and Python: A GuideApr 18, 2025 am 12:24 AM

PHP is suitable for web development and rapid prototyping, and Python is suitable for data science and machine learning. 1.PHP is used for dynamic web development, with simple syntax and suitable for rapid development. 2. Python has concise syntax, is suitable for multiple fields, and has a strong library ecosystem.

PHP and Frameworks: Modernizing the LanguagePHP and Frameworks: Modernizing the LanguageApr 18, 2025 am 12:14 AM

PHP remains important in the modernization process because it supports a large number of websites and applications and adapts to development needs through frameworks. 1.PHP7 improves performance and introduces new features. 2. Modern frameworks such as Laravel, Symfony and CodeIgniter simplify development and improve code quality. 3. Performance optimization and best practices further improve application efficiency.

PHP's Impact: Web Development and BeyondPHP's Impact: Web Development and BeyondApr 18, 2025 am 12:10 AM

PHPhassignificantlyimpactedwebdevelopmentandextendsbeyondit.1)ItpowersmajorplatformslikeWordPressandexcelsindatabaseinteractions.2)PHP'sadaptabilityallowsittoscaleforlargeapplicationsusingframeworkslikeLaravel.3)Beyondweb,PHPisusedincommand-linescrip

How does PHP type hinting work, including scalar types, return types, union types, and nullable types?How does PHP type hinting work, including scalar types, return types, union types, and nullable types?Apr 17, 2025 am 12:25 AM

PHP type prompts to improve code quality and readability. 1) Scalar type tips: Since PHP7.0, basic data types are allowed to be specified in function parameters, such as int, float, etc. 2) Return type prompt: Ensure the consistency of the function return value type. 3) Union type prompt: Since PHP8.0, multiple types are allowed to be specified in function parameters or return values. 4) Nullable type prompt: Allows to include null values ​​and handle functions that may return null values.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.