Skip to content

Get $env easier with $self->env#1

Open
MaxPerl wants to merge 4 commits intoMartinMcGrath:masterfrom
MaxPerl:MaxPerl-patch-1
Open

Get $env easier with $self->env#1
MaxPerl wants to merge 4 commits intoMartinMcGrath:masterfrom
MaxPerl:MaxPerl-patch-1

Conversation

@MaxPerl
Copy link

@MaxPerl MaxPerl commented Nov 27, 2016

Hello Martin,

I test at the moment the dev branch with a very basic PSGI Application. And I thought it could be a good idea to get $env easier through $self->env.
I know one can get it through $self->query->env, but I think becaus of the importance of the $env hash in PSGI Application, an own method is justified...

I propose that the $env can be pass in the new method new('ENV' => $env) and in the run_as_psgi($env) method. The first should no backward compatibility problem. The second can lead to some conflicts with plugins and modules (at least the comment in the run_as_psgi function says that some plugins need special arguments..)

Get $env easier with $self->env if CGI::Application is used as PSGI Application
@MartinMcGrath
Copy link
Owner

Hi Max,

thank you for this. Could you edit this PR to add some documentation in POD format for this new method?

@MaxPerl
Copy link
Author

MaxPerl commented Nov 29, 2016

Hello Martin,
I just edited POD documentation. Hopefully this is understandable.
We have to decide whether we also want to allow passing $env to run_as_psgi. As I said I perhaps see a backward compatibility problem. In the code there is this comment:

Run doesn't officially support any args, but pass them through in case some sub-class uses them

I don't know whether and which modules/sub-classes really use this possibilty. Do you have clou about this question?

I will add also a patch to psgi_app later on...

@MaxPerl
Copy link
Author

MaxPerl commented Nov 29, 2016

Oh I just saw that I forgot POD docu to the method $self->env.
Please give me some days for that...

@MaxPerl
Copy link
Author

MaxPerl commented Dec 2, 2016

Hi Martin,
I added now the docs also to the method $self->env...

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 this pull request may close these issues.

2 participants