芊雅企服
软件更新资讯

CakePHP 3.1.0 发布 PHP 开发框架

芊雅企服技术团队190 次浏览约 6 分钟读完

CakePHP 3.1.0 发布,此版本包含大量的改进:

  • ORM 增强
  • Mailers 允许创建可重用邮件
  • 模板提供额外的模板变量
  • Shell Helpers 可以让你轻松打包复杂输出生成代码
  • 刷新默认应用样式

相比 3.0 一些重要的改进:

  • FlashComponent now stacks Flash messages created with the set() or __call()methods. This means that the structure in the Session for stored Flash messages has changed.
  • New configuration option storage has been added. It contains the storage class name thatAuthComponent uses to store user record. By default SessionStorage is used.  If using a stateless authenticator you should configure AuthComponent to use MemoryStorage instead.
  • You can now also configure AuthComponent to do the auth check before controller’sbeforeFilter() callback is run using the checkAuthIn configuration. This is particularly useful when using stateless authenticators.
  • RequestHandlerComponent now switches the layout and template based on the parsed extension or Accept-Type header in the beforeRender() callback instead of startup()callback.
  • The default mime-type used when sending requests has changed in Http\Client. Previouslymultipart/form-data would always be used. In 3.1, multipart/form-data is only used when file uploads are present. When there are no file uploads, application/x-www-form-urlencodedis used.

其他改进

  • The default route class has been changed to DashedRoute in the cakephp/app repository. Your current code base is not affected by this, but it is recommended to use this route class from now on.
  • The breakpoint() helper function has been added. This function provides a snippet of code that can be put into eval() to trigger an interactive console.
  • Shell::dispatchShell() no longer outputs the welcome message from the dispatched shell.
  • You can now set _serialized to true for JsonView and XmlView to serialize all view variables instead of explicitly specifying them.
  • Time::fromNow() has been added. This method makes it easier to calculate differences from ‘now’.
  • Time::i18nFormat() now supports non-gregorian calendars when formatting dates.
  • Validation::latitude(), and Validation::longitude() were added.
  • Validation::ascii(), Validation::utf8(), andValidation::isInteger() were added.
  • Cache::add() was ported from 2.x. This method allows you to atomically add data to a cache backend if the key did not already exist.
  • Time::listTimezones() now supports options to display timezone abbreviations.
  • Hash::get() now supports objects implementing ArrayAccess.
  • Hash::sort() supports case-insensitive sorting through a new ignoreCase option.

废弃功能

  • The SessionHelper has been deprecated. You can use $this->request->session() directly.
  • The following Controller properties are now deprecated:

    Instead of setting these properties on your controllers, you should set them using the ViewBuilder.

    • layout
    • view
    • theme
    • autoLayout
    • viewPath
    • layoutPath

升级

php composer.phar require 'cakephp/cakephp:3.1.*'
php composer.phar require 'cakephp/debug_kit:3.2.*'
php composer.phar require 'cakephp/bake:1.1.*'

下载:cakephp-3-1-0.zip

CakePHP是一个运用了诸如ActiveRecord、Association Data Mapping、Front Controller和MVC等著名设计模式的快速开发框架。该项目主要目标是提供一个可以让各种层次的PHP开发人员快速地开发出健壮的Web应用,而 又不失灵活性。主要特性:

基于MVC架构
视图支持Ajax
内置校验框架
提供应用程序的基础模块和CRUD 代码自动生成功能
提供处理session,request,security的组件
灵活的视图缓存功能
面向对象
无需配置:只要安装好数据库
兼容PHP4和PHP5。

相关文章

软件更新资讯Firefox 135.0 发布

Firefox 135.0 现已发布,具体更新内容如下: New Firefox 翻译现在支持比以往更多的语言…

1db25d63924c2fff4d7feb76cf041519软件更新资讯2025年无人自助棋牌室还能不能做?2025年还能不能做共享茶室

2025年还能不能做共享茶室,其实很尴尬,毕竟经济很差。但是我们给的建议是,如果手上有闲钱,有合适的场地,这种…

22软件更新资讯共享茶室加盟好还是自营好?

共享茶室是一种新兴的商业模式,包括加盟和自营两种经营方式。那么,到底是选择共享茶室加盟还是自营更好呢?这个问题…

cd9e2de08dacbe576c20a768773a8972软件更新资讯成都共享棋牌室系统多少钱?成都开共享棋牌室为什么选择芊雅共享棋牌室系统

成都共享棋牌室系统的价格取决于您选择的具体系统和规模。不同的系统功能和设备不同,其价格也会有所不同。在成都,共…

1软件更新资讯厦门宝丹鹭共享空间平台上线,厦门共享茶室系统哪家好?

厦门宝丹鹭共享空间平台上线,主打商务接待场景,由芊雅共享茶室系统强力驱动。近期我们将实地参观本福建的共享空间,…

Gym man and woman push-up strength pushup with dumbbell in a crossfit workout软件更新资讯健身APP开发帮助用户解决各种健身问题

我们都知道每一个胖子都是资深的潜力股,可以看出身形的塑造改变的不单单是外边,更多的是气质,如今越来越多人都加入…

免费获取你的专属方案。

资深技术顾问一对一诊断需求,为你量身定制方案与报价。

  • 免费需求诊断与方案建议
  • 透明报价,工期明确
  • 现成方案与定制开发灵活组合
电话咨询135 0699 3986

信息仅用于顾问联系你,绝不外泄。

电话咨询免费获取方案

和技术顾问聊聊,免费拿方案。

说说你的行业和想法,顾问免费评估方案与报价。

电话咨询135 0699 3986一键拨打
微信号fzqianya
技术顾问微信二维码
微信扫一扫添加技术顾问,直接沟通需求截图保存后,在微信“扫一扫”中选择图片识别

不方便沟通?留下电话,顾问回电