编程开源技术交流,分享技术与知识

网站首页 > 开源技术 正文

Laravel 5.5 升级到 6.0 踩坑记录

wxchong 2024-11-16 01:31:07 开源技术 16 ℃ 0 评论

1. 使用 phpredis 替代 predis

Laravel 开始推荐使用 phpredis 来代替 predis。

所以要记得先安装 phpredis, 然后在 config/app.php 中去掉 Redis 别名

Mac 安装

# 这里需要将当前版本设置为主版本才可以, 如果不是主版本则安装会太费劲
$ brew link --force php@{version}
$ pecl install igbinary
$ pecl install redis
$ brew services restart php@7.2

其他平台

应该是直接安装即可 (未测试)

2. Unable to create configured logger. Using emergency logger

在 5.6 之后已经将配置文件独立 config/logging.php, 将这个文件放置到指定目录,然后 app.php 移除日志的配置 Logging Configuration

3. Call to undefined method Illuminate\Events\Dispatcher::fire()

在 (5.8 升级指南)(https://learnku.com/docs/laravel/5.8/upgrade) 指出,

Likelihood Of Impact: Low

deprecated and removed
Events The fire Method

使用 dispatch 方法替代 You should use the dispatch method instead.

4. Class 'Illuminate\Support\Facades\Input' not found

使用 Request 替代 Input

Input no longer exists. Either use the Request facade or alias that instead of Input.

5. str_contains 等 helper 函数

这些函数均需要替换成静态函数方法 Str::contains

Tags:

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表