Autoloading

If your project does not implement autoloading, you can generate one using composer. The steps are as follows.

1. Modify composer.json
Add "" : "./" to autoload.psr-4 in composer.json, for example

{
    "require": {
        "workerman/workerman" : "^v4.0.0"
    },
    "autoload": {
        "psr-4": {
            "" : "./"
        }
    }
}

2. Generate autoload.php
Execute composer dumpautoload

3. Load autoload.php
Load vendor/autoload.php at the top of your project's start.php, for example

<?php
require_once __DIR__ . '/vendor/autoload.php';

4. Restart workerman
php start.php restart