Skip to content

Latest commit

 

History

History
117 lines (75 loc) · 3.9 KB

File metadata and controls

117 lines (75 loc) · 3.9 KB

Development Environment

A git-based setup for working on the HumHub core or modules. Not for production — production installs follow the admin installation guide.

Requirements

Installation

1. Create the database

CREATE DATABASE `humhub` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

More on database setup: admin server-setup guide.

2. Clone the repository

git clone https://github.com/humhub/humhub.git

3. Install Composer dependencies

In the web-root (the cloned repo):

composer install

4. Run the web installer

The installer is at http://localhost/humhub (or wherever you pointed your web server). The admin installation guide covers file permissions and other server-side details.

Configuration

Copy .env.example to .env and adjust as needed.

For a development install:

  • Keep DEBUG mode enabled (default — Enable Debug Mode)
  • Disable caching under Administration → Settings → Advanced → Caching → None
  • Use file-based mailing under Administration → Settings → Advanced → E-Mail

Queue

HumHub uses queued jobs for notifications, mails and other background work. In development, either configure the Instant or Sync queue, or run jobs manually:

php yii queue/run

For production-like behaviour, set up the cron worker.

Module loader path

By default modules are loaded from @humhub/protected/modules. Add custom paths via .env:

HUMHUB_CONFIG__PARAMS__MODULE_AUTOLOAD_PATHS=['/some/folder/modules', '/some/other-folder/modules']

This is useful for keeping your own modules separate from marketplace modules, or for sharing a central module directory across multiple test installations.

Yii Debug Toolbar

Enable the Yii Debug Module for request and query profiling.

Via .env:

HUMHUB_CONFIG__BOOTSTRAP=['debug']
HUMHUB_CONFIG__MODULES__DEBUG='{"class":"yii\\\\debug\\\\Module","allowedIPs":["127.0.0.1","::1"]}'

Or in protected/config/web.php:

return [
    'bootstrap' => ['debug'],
    'modules' => [
        'debug' => [
            'class' => 'yii\debug\Module',
            'allowedIPs' => ['127.0.0.1', '::1'],
        ],
    ],
];

Updating

For a git-based install:

git pull origin master
composer install
php yii migrate/up --includeModuleMigrations=1

The HumHub Updater module does not work on git-based installations.

Production mode

A git checkout won't run in production mode without building production assets. The build is also required to run acceptance tests.

Test environment

See the testing guide for setting up the test environment.

Developer tools module

The devtools module provides example components and a module skeleton generator based on Gii.