Created attachment 8388 [details] [review] proposed patch
Created attachment 8423 [details] [review] Bug 7769 - members/pay.pl: $template scoping for plack
Testing ok, signing off
Created attachment 8445 [details] [review] Bug 7769 - members/pay.pl: $template scoping for plack Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>
Okay, this is a very simple change, 2 char for 3, but I need a little more knowledge before I can QA it. We're changing 'my' to 'our'. This increases the scope of the 3 variables, $template, $loggedinuser and $cookie to be global to the module, which makes sense. I *think* we need to do this because several subroutines within members/pay.pl alter $template, and the way that plack or mod_perl work more explicit scoping is required. Is this the case? Are there any side effects of changing this scope for a non-persistent setup?
I don't think there are any side-effect on non-persistent setup, and indeed we are doing this because we reference it inside subs. It would be enough to scope just $template, and to be pedantic, we are defining three global variables instead of one which does increase memory usage in persistent environment, but alternatives would require larger code changes.
Dobrica, Thanks for the info. Looks like I'm not as far behind as I feared. While this does global scope 3 variables instead of just one, it's only two more variables (how many bytes is that?), and the code change is easier to read, understand and QA. Given this, I'm going to pass this patch through QA. I'll give some time to test for strange, unexpected changes in behavior, and assuming everything behaves like we want, I'll start passing the rest of the plack variable scoping changes.
Ian, if you want/need more info: http://wiki.koha-community.org/wiki/Plack#Running_Intranet and more specifically: Second day of plack testing showed that we are somewhat away from goal of running intranet under plack. Currently biggest problems are variabled declared with my which are inside sub (since plack wraps our cgi scripts within sub). This problem is similar to mod_perl problem described at http://modperlbook.org/html/6-2-Exposing-Apache-Registry-Secrets.html (just ignore mod_perl references :-) I find this solution a little bit dirty, but, oth, the speed under Plack is so... astonishing, that my feeling is nothing ;-) (gain = speed x5, outside from zebra speed/queries) Note : most of the patch dobrika made yesterday and today fix the problem that way. If you havent QAed them, i'll QA now that you agree Just in case = this patch should not be applied on 3.6.
There have been no further reports of problems so I am marking this bug resolved.