[Koha-devel] Plack and CGI : where to put initialization code ?

Francesco Rivetti oha at oha.it
Mon Apr 10 10:42:48 CEST 2017


On 10. april 2017 10:39, Julian Maurice wrote:
> I need to execute code at the beginning of every request. For now it's
> in a BEGIN block. It works well in CGI mode, but not at all with plack
> (it's only executed once).
> I tried moving the BEGIN block into a sub init(), calling this sub in
> the BEGIN block and in the PSGI file (in CGI::new wrapper). It works but
> it doesn't feel "right".

probably the best way in plack is to "enable" it in the build chain, 
like it is happening with Koha::Middleware::SetEnv in plack.psgi

HTH

F


More information about the Koha-devel mailing list