Problem/Motivation
1. Current Reports > Packages list does not include any warnings for autoload library types which are not supported by Ludwig yet ('classmap' and 'files' types). These libraries are listed as "Missing" even after they are downloaded and unpacked into proper folder structure.
2. PSR-4 and PSR-0 libraries are not supported currently if their autoload section has multiple resources or multiple resource paths.
Steps to reproduce
1. Install Social Feed Aggregator module using ludwig.json file listed in comment #2 here: #3012829-2: Social Feed Aggregator - Add Ludwig integration. Download and unpack all 3 libraries into proper folder structure.
Ludwig can handle abraham/twitteroauth PSR-4 library nicely.
However, aodto/phasher library is classmap autoload type, and brynj-digital/social-feed library is files autoload type. Ludwig does not support these two autoload types yet. But there is no any warning inside Reports > Packages to inform user that these two autoload types are unsupported at the moment. Instead, these two libraries are reported as "Missing" still - which is both wrong and not very helpful.
2a. The example of PSR-4 library with multiple autoload resources is from Brightcove Video Connect module. Install the module and add ludwig.json file with patch #17 from here: #3009048-17: Brightcove Video Connect - Add Ludwig integration. Download and unpack brightcove/api library into proper folder structure.
brightcove/api library has composer.json/autoload section as follows:
"autoload": {
"psr-4": {
"Brightcove\\": "lib/Brightcove/",
"Brightcove\\Test\\": "test/Brightcove/Test/"
}
}
Currently, Ludwig handles just the first resource (lib), and the other one (test) is silently ignored.
2b. The example of PSR-4 library with multiple resource paths is from SendGrid Integration module. Install 8.x-1.x-dev version of the module. Download and unpack all 3 libraries into proper folder structure.
Ludwig handles PSR-4 fastglass/sendgrid and PSR-0 sendgrid/smtpapi libraries nicely.
However, html2text/html2text library has composer.json/autoload section as follows:
"autoload": {
"psr-4": { "Html2Text\\": ["src/", "test/"] }
}
And Ludwig can not handle an array of paths (["src/", "test/"]) at the moment, therefore reporting this library as "Missing" still.
Proposed resolution
Add warnings for unsupported autoload types ('classmap' and 'files') and fix multiple resources/paths issues for PSR-4 and PSR-0 libraries.
Remaining tasks
Make a patch.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | Interdiff_2_4.txt | 2.65 KB | devad |
| #4 | ludwig-3177450-4.patch | 9.56 KB | devad |
| #2 | ludwig-3177450-2.patch | 8.47 KB | devad |
Comments
Comment #2
devad commentedAll-in-one patch to fix all the issues described above.
Comment #3
devad commentedIgnore this one.
Comment #4
devad commentedFixing tests and coding standards.
Comment #5
devad commentedInterdiff.
To test the patch manually follow and complete steps 1, 2a and 2b described in issue summary and visit Reports > Packages.
Notable changes:
Comment #6
devad commentedComment #8
devad commentedCommitted to 8.x-1.x-dev.
Comment #9
devad commentedHere is a follow-up with some further improvements: #3180980: Add support for PSR libraries with multiple paths