Skip Menu |

This queue is for tickets about the CGI-Application-Dispatch CPAN distribution.

Report information
The Basics
Id: 68909
Status: rejected
Priority: 0/
Queue: CGI-Application-Dispatch

People
Owner: MARKSTOS [...] cpan.org
Requestors: james2vegas [...] aim.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 3.00
Fixed in: (no value)



Subject: New CGI::Application::Dispatch::PSGI requires a larger set of changes
The changes in 3.00 with the bundled CGI::Application::Dispatch::PSGI requiring the change of base class in the Dispatch classes, as opposed to injection of an as_psgi method (the previous method) cause those Dispatch classes to be PSGI-only, unable to be used without PSGI, and force modification of potentially large Dispatch classes instead of the creation of, usually, simple .psgi files.
Thanks for the feedback, James. Could you provide a small pseudo-code example of the case you provide problematic? Mark
Perhaps we could Exporter to allow "as_psgi()" to be pulled in from the side, as well as being inherited as it is now. Would you be interested in check that this could be supported? It should be matter of adding "as_psgi() to an @EXPORT_OK list, and then testing that. Mark
I'm considered this some more and I appreciate the interest in only making changes in a PSGI script to add support an existing Dispatch module. Could you test it if it works start exporting as_psgi() again? ( Basically, support both the old and new behaviors ). Thanks. Mark
Thanks again for your feedback on this James. Have had a chance to look at this further? Mark On Tue Jun 21 08:27:16 2011, MARKSTOS wrote: Show quoted text
> I'm considered this some more and I appreciate the interest in only > making changes in a PSGI script to add support an existing Dispatch > module. > > Could you test it if it works start exporting as_psgi() again? ( > Basically, support both the old and new behaviors ).
I was unable to get this to work the old way, there was no EXPORT_OK to modify and adding the import sub from KAPPA/CGI-Application-Dispatch-PSGI-0.2/lib/CGI/Application/Dispatch/PSGI.pm

sub import {
    no strict 'refs';
    *{CGI::Application::Dispatch::as_psgi} = \&as_psgi;
}
while allowing previous non-loading Dispatch classes to load caused 'response should be array ref or code ref' instead of expected content
CC: undisclosed-recipients:;, James Wright via RT <bug-cgi-application-dispatch [...] rt.cpan.org>
Subject: Re: [rt.cpan.org #68909] New CGI::Application::Dispatch::PSGI requires a larger set of changes
Date: Tue, 13 Sep 2011 16:32:37 -0400
To: bug-CGI-Application-Dispatch [...] rt.cpan.org
From: Mark Stosberg <mark [...] summersault.com>
Thanks for your research. I'll take another look.
With feedback from no one else in about a year, I'm deciding not to pursue this further. One of the features of PSGI/Plack is that you can run the same code in multiple environments without modifying your code. That can be done by using the PSGI dispatcher, and the CGI handler for Plack. Like other frameworks, I think CGI::App is headed more towards being PSGI-only in the future, and supporting the older non-PSGI code path is becoming less of a priority.