Laminas-component-installer does not add modules into config

I have a repository on GitLab that installs all dependencies with the command composer create-project -s dev lerp/lingana-erp-project /var/www/html/lingana_test. But it doesn’t add any modules to /config/*config.php.

https://gitlab.com/laminas-erp/lingana-erp-project

The package “laminas/laminas-component-installer” is one of the dependencies.

Each of my modules has the entry extra.laminas.module in the composer.json.

And also no Laminas modules are added to a config.

What am I doing wrong or what is missing?

Have you tested if it works with a single module? For example: lerp/customer

I have tested it without all my own modules. Therefore the error is in the root project and not in one of my modules from the root composer.json “require”.

And tested with a module (only one) that requires no dependencies.

In both cases nothing is written to a config.

Hm. You should add modules to config and commit them in your project repository.

I think the problem might be that component installer is rather dumb and it looks for a config array that is multiline where one module entry is on one line.

Try to replace empty config with

return [
];

Also, I do not remember if plugin is triggered when installing locked dependencies or only on update event when each specific dependency providing the module would be updated in the lock file.

2 Likes

That was the problem. With a multiline array it works. All modules are now in the modules.config.php.
Thank you.