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.

Comments

devad created an issue. See original summary.

devad’s picture

StatusFileSize
new8.47 KB

All-in-one patch to fix all the issues described above.

devad’s picture

StatusFileSize
new9.43 KB

Ignore this one.

devad’s picture

StatusFileSize
new9.56 KB

Fixing tests and coding standards.

devad’s picture

Status: Active » Needs review
StatusFileSize
new2.65 KB

Interdiff.

To test the patch manually follow and complete steps 1, 2a and 2b described in issue summary and visit Reports > Packages.

  1. Both Social Feed Aggregator libraries should be marked as not supported with bold warning.
  2. brightcove/api library should have two records at packages list.

Notable changes:

  • The unsupported libraries are not marked as "Missing" any more after downloading and unpacking is done properly.
  • A warning is added into library description if is not supported.
  • Previous "Version" column is renamed to "Type, Version" listing both autoload type and current version of downloaded library. If the library is not downloaded yet, the type is listed as "unknown".
  • For libraries with multiple resources an additional argument (path) is appended to library name for distinction reasons.
devad’s picture

  • devad committed 819e8ed on 8.x-1.x
    Issue #3177450 by devad: Add warnings about unsupported autoload types...
devad’s picture

Status: Needs review » Fixed

Committed to 8.x-1.x-dev.

devad’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.