如何在 Humhub 中手动安装聊天模块

How to manually install chat module in Humhub

我刚刚安装了 humhub 并从 github 下载了聊天模块。 https://github.com/ychoucha/HUMHUB-module-chat 我将它克隆到 humhub/protected/modules。但是,它不会出现在管理登录的模块部分。我如何在 Humhub 中安装这个或其他第三方模块?

根据 2014 年 9 月 12 日 link https://github.com/humhub/humhub/issues/165,卢克说:

您也可以手动安装模块:

  1. 下载模块(例如邮件)
  2. 放入protected/modules/mail
  3. 在管理 -> 模块中启用它

我已经尝试使用任务模块并且它有效。确保您拥有来自 Humhub 存储库的最新稳定版本的代码。您还必须能够直接从“管理”>“模块”>“在线查找”

下载

自 humhub v1.0 后该模块不再有效。

根据文档,您需要添加一个 config.php 文件。 https://www.humhub.org/docs/guide-dev-module.html

config.php(替换 autostart.php)

<?php

use humhub\modules\dashboard\widgets\Sidebar;

return [
    'id' => 'chat',
    'class' => 'humhub\modules\chat\ChatModule',
    'namespace' => 'humhub\modules\chat',
    'events' => [
    array(
        'class' => Sidebar::className(), 
        'event' => Sidebar::EVENT_INIT, 
        'callback' => array(
            'humhub\modules\chat\ChatModule',
            'onSidebarInit'
            )
        ),
    ],
];