Closed (fixed)
Project:
PHP Preloader
Version:
1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
18 Jul 2020 at 05:02 UTC
Updated:
1 Aug 2020 at 05:54 UTC
Jump to comment: Most recent
The preload script generated by the module doesn't work as it could contain files which are present in modules. These files may, in turn, refer to classes, interfaces, or traits which might not have yet been loaded. Since composer cannot find such classes in modules, we have to explicitly add them to the autoloader similar to this:
/** @var \Composer\Autoload\ClassLoader $loader */
$loader = require_once '/app/web/autoload.php';
$loader->addPsr4('Drupal\field\\', "/app/web/core/modules/field/src/");
$loader->addPsr4('Drupal\views\\', "/app/web/core/modules/views/src/");
Comments
Comment #3
hussainweb