copyrenzhe / novel

基于 Laravel 5.2 的小说网站

Home Page:http://www.shu000.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

您好,安装完报了一个错误,请问这个是什么问题呢?

HelplessMan opened this issue · comments

ErrorException in CommonController.php line 21:
Use of undefined constant inf - assumed 'inf' (this will throw an Error in a future version of PHP)

提示未定义常量?

CommonController 控制器方法

namespace App\Http\Controllers;

use App\Models\Novel;
use App\Http\Requests;
use Cache;

class CommonController extends Controller
{
    //
    protected $genres;

    /**
     * CommonController constructor.
     */
    public function __construct()
    {

        $hotNovels = [];
        $hotNovels['total'] = \Redis::zRevRangeByScore(config('cache.redis.view_total'), -inf, +inf,
            ['withscores' => true, 'limit' => [0, 8]]);
        $hotNovels['month'] = \Redis::zRevRangeByScore(config('cache.redis.view_month'), -inf, +inf,
            ['withscores' => true, 'limit' => [0, 8]]);
        $hotNovels['week'] = \Redis::zRevRangeByScore(config('cache.redis.view_week'), -inf, +inf,
            ['withscores' => true, 'limit' => [0, 8]]);

        $genres = \Cache::rememberForever('genres', function() {
            return category_maps();
        });
        $this->genres = $genres;
        view()->composer(['common.right', 'common.navbar'], function($view) use($hotNovels, $genres) {
            $view->with('hotNovels', $hotNovels)->with('genres', $genres);
        });
    }
}

这个是因为我没有安装redis 的服务吗?