Skip Menu |

This queue is for tickets about the Mojo-Server-FCGI CPAN distribution.

Report information
The Basics
Id: 43267
Status: resolved
Priority: 0/
Queue: Mojo-Server-FCGI

People
Owner: Nobody in particular
Requestors: GLORYBOX [...] cpan.org
Cc: ejs [...] cpan.org
AdminCc:

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



CC: EJS [...] cpan.org
When using Mojo::Server::FCGI::Prefork, there is no possibility to set application class using $ENV{MOJO_APP} environment variable or $server->app_class() accessor. The problem brakes in two parts: 1) There is no way to access Mojo::Server::FCGI app_class attribute, because when you set it for Mojo::Server::FCGI::Prefork->app_class you set for next hierarchy: Mojo::Server::Daemon::Prefork -> Mojo::Server::Daemon -> Mojo::Server. Mojo::Server::FCGI which is instantiated in parent() routine doesn't get this value. 2) Anyhow, one may say setting it via environment should work, but it doesn't. The problem with attributes is that it's default value isn't calculated until the moment you really need to get it's value. In Mojo::Server, app_class default value is defined as follows: default => sub { $ENV{MOJO_APP} ||= 'Mojo::HelloWorld' }. This whole setup led to following issue: if you try to access app_class somewhere in parent() routine it gets it's value from $ENV{MOJO_APP} since %ENV is still available and Mojolicious or other application is working if not - it is initialized somewhere in child()/process() routine where %ENV is completely rewritten with FastCGI headers so it gets Mojo::HelloWorld value, not very useful.
Added fcgi attribute in latest release to make the Mojo::Server::FCGI object accessible.