Due to legacy I have a CMS with its own autoloader. Compsoser joined the party to manage some dependencies to ease payment integrations. However, I found the two autoloaders are conflicting with each other. Then I found I can use classmap in composer.json, but this doesn't seem to fix my issue - the requested class is not found.
For example I have a MySQL class, that resides in a file called Database.php. Using classmap so far I have been unable to properly load the MySQL class when I enter the filepath to Database.php in it. However, using the files container it works. But, if possible I want to prevent to brute force include all legacy classes for each page request.
I'm wondering if there's a possibility to define a key-value mapping for a classmap-like behavior. Thereby defining my composer.json something like:
{
"require" : {
"vendor/payment-service-provider-package": "version-data"
},
"autoload": {
"classmap": [
"MySQL" => "./CMS/Classes/Database.php",
"..." => "./CMS/Classes/....php"
]
}
}