diff options
author | Eric Wong <e@yhbt.net> | 2020-01-10 08:49:31 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-01-11 21:16:26 +0000 |
commit | 62f28026e624ed30d620063a0fa92cbedb7f6673 (patch) | |
tree | 8cdd2a4646c3304e5a6072e824fe5da2aa05eea8 /script/public-inbox.cgi | |
parent | f018d5cc70f3a6983e4ec188ae62a729a8b31157 (diff) | |
download | public-inbox-62f28026e624ed30d620063a0fa92cbedb7f6673.tar.gz |
Some users just want to run -mda, -watch, and/or -nntpd. Let them run just those without forcing them to pull in a bunch of dependencies.
Diffstat (limited to 'script/public-inbox.cgi')
-rwxr-xr-x | script/public-inbox.cgi | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/script/public-inbox.cgi b/script/public-inbox.cgi index c0e8e6c3..c766483a 100755 --- a/script/public-inbox.cgi +++ b/script/public-inbox.cgi @@ -1,14 +1,17 @@ #!/usr/bin/perl -w -# Copyright (C) 2014-2019 all contributors <meta@public-inbox.org> +# Copyright (C) 2014-2020 all contributors <meta@public-inbox.org> # License: AGPL-3.0+ or later <https://www.gnu.org/licenses/agpl-3.0.txt> # # Enables using PublicInbox::WWW as a CGI script use strict; -use warnings; -use Plack::Builder; -use Plack::Handler::CGI; -use PublicInbox::WWW; -BEGIN { PublicInbox::WWW->preload if $ENV{MOD_PERL} } +BEGIN { + for (qw(Plack::Builder Plack::Handler::CGI)) { + eval("require $_") or die "E: Plack is required for $0\n"; + } + Plack::Builder->import; + require PublicInbox::WWW; + PublicInbox::WWW->preload if $ENV{MOD_PERL}; +} my $www = PublicInbox::WWW->new; my $have_deflater = eval { require Plack::Middleware::Deflater; 1 }; my $app = builder { |