ThinkOrm 错误

siwei

问题描述

大咖们,请帮忙排错!
https://www.bilibili.com/video/BV1Wu41117Xt/?p=3&spm_id_from=pageDriver&vd_source=3027986b738a23caaa16eaaa82e4c41b
按照这个视频,安装了
bootstrap.php

return [
    support\bootstrap\Session::class,
    support\bootstrap\ThinkOrm::class,
    // support\bootstrap\LaravelDb::class,
    Webman\ThinkCache\ThinkCache::class,
    Webman\ThinkOrm\ThinkOrm::class,
];
===============================
IndexController.php

public function index(Request $request)

{   
 $art= new Article();
 $list=$art->select();
 dump($list)
 View::assign('list',$list);
 return view('index/index');
}

报错信息

在控制台 报错如下:

------------------------ WORKERS -------------------------------
worker                        listen                              processes status
webman               http://0.0.0.0:8787                 4         [ok]
Warning: Class support\bootstrap\ThinkOrm setting in config/bootstrap.php not found
monitor              none                                1         [ok]
Warning: Class support\bootstrap\ThinkOrm setting in config/bootstrap.php not found

操作系统及workerman/webman等框架组件具体版本

Workerman version:4.1.8 PHP version:8.0.2

848 2 0
2个回答

稚出

按文档来装

  • siwei 2023-03-09

    一切按照 这个安装的 https://www.workerman.net/a/1355

  • siwei 2023-03-09

    请问哪位大咖的大作是完全按照ThinkOrm+ThinkCache+think-template+ redis,原生态来的,我参考一下

  • yongdao35 2023-03-09

    按照手册用composer安装就行了

    创建项目

    composer create-project workerman/webman

    进入 webman目录执行

    composer -W require psr/container ^1.1.1 webman/think-orm  webman/think-cache topthink/think-template

    修改配置config/view.php为

    <?php
    use support\view\ThinkPHP;
    return [
        'handler' => ThinkPHP::class,
    ];

    数据库和cache 配置文件分别在 config/thinkorm.php config/thinkcache.php

ichynul

年代过于久远,无法发表回答
×
🔝