Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a Drush command to generate configuration #343

Open
mglaman opened this issue Feb 17, 2022 · 5 comments · May be fixed by #391
Open

Provide a Drush command to generate configuration #343

mglaman opened this issue Feb 17, 2022 · 5 comments · May be fixed by #391

Comments

@mglaman
Copy link
Owner

mglaman commented Feb 17, 2022

Drush allows libraries to provide commands via autoloading patterns.

phpstan-drupal could provide one which generated the phpstan.neon for a project. It could also generate the entity mapping and other stateful information as a dump

@mxr576
Copy link
Contributor

mxr576 commented Feb 17, 2022

Do not just auto-generate entity mapping and other stateful information once because they change as the time passes. Also provide a command to keep those up to date - maybe verify them on the CI to check if they are outdated (like a new module was installed that provides X entity type => your current entity mapping is outdated).

@brambaud
Copy link
Contributor

For information, I was working on a custom kernel to dump everything: DI container with all the services (public, private), entity mapping, field definitions (to have information about dynamic properties etc..) and everything that are known runtime in Drupal.

The aim is to be able to analyse more things and in an easier way (we could get rid of loading all the services by ourself).
It could automatically dump everything when something changes (like with Symfony).

I already have a POC for the DI container (it was really really simple to do with a small custom kernel and a small custom DI dumper!)

Do you have any interest on this?

@mglaman
Copy link
Owner Author

mglaman commented Feb 17, 2022

@mxr576 we wouldn't do anything. It's something folks would do and run on their own. As a helper utility. Which folks could run in their CI and diff changes.

@mglaman
Copy link
Owner Author

mglaman commented Feb 17, 2022

@brambaud I do! It'd be interesting to see how you overcame the InstallerKernel, UpdateKernel, and the extended Drush ones. Or this intended to only swap the main index kernels

@brambaud
Copy link
Contributor

@mglaman For the moment the POC for the CI container is just a command line script replacing the main Drupal kernel.

For another purpose I also played by totally replacing the main kernel by changing the autoload (see https://github.com/ekino/drupal-debug#original-drupal-kernel-substitution for more information (I have to rework this lib from scratch because I let it rot for too long and the maintenance was too hard. I also have some ideas that require the same process so I don't know yet which one will come first)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants