返回介绍

Updating For Beta 12

发布于 2021-11-04 22:44:46 字数 4237 浏览 1033 评论 0 收藏 0

Beta 12 packs several new features for extension developers, but also continues our cleanup efforts which results in a few changes, so please read this guide carefully to find out whether your extensions are affected. We invested extra effort to introduce new functionality in a backward-compatible manner or first deprecate functionality before it will be removed in the next release, in line with our versioning recommendations.

tip

If you need help applying these changes or using new features, please start a discussion on the community forum or Discord chat.

  • Reminder: In previous versions of Flarum, an extensions' main file was named bootstrap.php. This name will no longer be supported in the stable 0.1 release. Make sure your extension uses the name extend.php.
  • PHP 7.1 support will be dropped in beta.13.
  • Using library classes from the Zend namespace is now deprecated and will be removed in beta.13. Use the Laminas namespace instead. See PR #1963.
  • The Flarum\Util\Str::slug() method has been deprecated. Use Illuminate\Support\Str::slug() instead.
  • The Flarum\Event\ConfigureMiddleware has been deprecated. We finally have a proper replacement - see "New Features" below. Therefore, it will be removed in beta.13.
  • If you implement the Flarum\Mail\DriverInterface:
    • Returning a plain array of field names from the availableSettings() method is deprecated, but still supported. It must now return an array of field names mapping to their type. See the inline documentation for more details.
    • Implement the validate() method that will be required in beta.13. See its documentation.
    • Implement the canSend() method that will be required in beta.13. See its documentation.

  • New PHP extenders:
    • Flarum\Extend\Middleware offers methods for adding, removing or replacing middleware in our three middleware stacks (api, forum, admin). We also added documentation for this feature.
    • Flarum\Extend\ErrorHandling lets you configure status codes and other aspects of our error handling stack depending on error types or exception classes.
  • JavaScript:
    • The flarum/components/Select component now supports a disabled prop. See PR #1978.

  • The TextFormatter library has been updated to (at least) version 2.3.6. If you are using it (likely through our own Flarum\Formatter\Formatter class), we recommend scanning the library's changelog.
  • The JS slug() helper from the flarum/utils/string module should only be used to suggest slugs to users, not enforce them. It does not employ any sophisticated transliteration logic like its PHP counterpart.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文