symplify icon indicating copy to clipboard operation
symplify copied to clipboard

Data Provider only feature

Open JWBrownie opened this issue 1 year ago • 9 comments

Allows the user to pass an argument that allows to only process controllers via withDataProvider excluding access to controllers indiscriminately.

symfony console dump-static-site --wdp-only

JWBrownie avatar Jul 11 '22 21:07 JWBrownie

Hi, thanks for PR. What is the use case for this?

TomasVotruba avatar Jul 11 '22 21:07 TomasVotruba

Friendly ping :slightly_smiling_face:

TomasVotruba avatar Jul 17 '22 14:07 TomasVotruba

Closing for lack of feedback. We're narrowing issues to keep focus on active and engaging contributor to keep project growing. :+1: Thank you for understanding.

Feel free to re-open and make CI pass, if this is still releveant

TomasVotruba avatar Jul 22 '22 15:07 TomasVotruba

Hey Tomas, sorry I was out of town just getting back, the use case is the following:

The export fails when you got controllers with authorization, it will not export because you are not passing an user credentials, so what I did is to integrate a flag to avoid the exporter looking into all the controllers but only the ones WithDataProvider which are the ones defining the correct functions to public addresses in the platform.

JWBrownie avatar Jul 22 '22 17:07 JWBrownie

Now I am going back to the source code because when adding a Site Prefix the exporter will double export the prefix of the platform for example:

Currently doing: Site prefix: mydomain.com/my-site-prefix/ Exports: to path: output/my-site-prefix/my-site-prefix/

So it's duplicating the my-site-prefix for the output of the controllers everything else is exported correctly (since it is a cp from public)

Regards,

JWBrownie avatar Jul 22 '22 18:07 JWBrownie

Thanks for reaching out :+1:

The export fails when you got controllers with authorization, it will not export because you are not passing an user credentials, so what I did is to integrate a flag to avoid the exporter looking into all the controllers but only the ones WithDataProvider which are the ones defining the correct functions to public addresses in the platform.

I'm not sure this need and extension. It can be handled in custom data provider.

TomasVotruba avatar Jul 22 '22 18:07 TomasVotruba

Yes I know, I add the custom data provider and execute the command and it fails because I will scan all controllers regardless. But okay for my use case I am using my own repository for the project I added it to, if not I'll rewrite the whole thing, I'm new to symfony and getting used to it I think I'm learning pretty fast.

JWBrownie avatar Jul 22 '22 18:07 JWBrownie

Adding more on this, I am not sure if the error I am getting is due my custom data providers living inside a sub directory in my controllers folder, could this be the issue? Because despite having these the dump-static-site command will look all of the controllers throwing the error of not injected dependencies (auth, or others).

Could that be the issue?

JWBrownie avatar Jul 23 '22 16:07 JWBrownie

Adding more on this, I am not sure if the error I am getting is due my custom data providers living inside a sub directory in my controllers folder, could this be the issue?

Not sure. If you move them to directory above, would it help?

TomasVotruba avatar Jul 23 '22 17:07 TomasVotruba