Autoloader usage
Directory structure
httpclient/
src/
vendor/
index.php
Composer initialization
composer init
Update composer.json file
"autoload": {
"psr-4": {
"minte9\httpclient\": "vendor/minte9/httpclient/src/"
},
"classmap": [
"src/"
]
}
Generate autoload files (vendor/composer/autoload*)
composer dump-autoload
View changes in files
autoload_classmap.php
return array(
'DssParser' => $baseDir . '/src/DssParser.php',
'RapidapiParser' => $baseDir . '/src/RapidapiParser.php',
);
autoload_psr4.php
return array(
'minte9\httpclient\' => array($vendorDir . '/minte9/httpclient/src'),
);
Replace your autoloader with composer autoloader
// index.php
require_once __DIR__ . '/vendor/autoload.php';
Last update: 465 days ago