ऑटो लोडिंग

यदि आपके प्रोजेक्ट में ऑटो लोडिंग लागू नहीं है, तो आप composer का उपयोग करके एक उत्पन्न कर सकते हैं, चरण इस प्रकार हैं।

1. composer.json में परिवर्तन करें
composer.json में autoload.psr-4 में "" : "./" जोड़ें, उदाहरण के लिए

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

2. autoload.php जनरेट करें
composer dumpautoload चलाएँ

3. autoload.php लोड करें
प्रोजेक्ट के start.php के शीर्ष पर vendor/autoload.php लोड करें, उदाहरण के लिए

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

4. workerman रीस्टार्ट करें
php start.php restart