[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] app server, parsing @argv in Server.pm
Quoting cfm@maine.com (cfm@maine.com):
>
>
> Re ic/mv as app server:
>
> I want to do this:
> vlink -a asdf -b asdf -c asdf -d asdf -e etc... # $ENV has CGI vars
>
> And I'm looking at this code at start of lib/Vend/Server.pm:
>
> > sub new {
> > my ($class, $fh, $env, $entity) = @_;
> > if(@Global::argv > 1) {
> > (
> > $CGI::script_name,
> > $CGI::values{mv_session_id},
> > $CGI::query_string
> > ) = @Global::argv;
> > map_cgi();
> > $Global::FastMode = 1;
> > return bless { fh => $fh }, $class;
> > }
> > populate($env);
> >
>
> Thinking that maybe I might modify an appserver version of
> vlink to unshift in 'appserver' as argv[0] so something like
> this would work:
>
> if($Global::argv[0] eq 'appserver') {
> # shift and parse @arg first
> }
> if(@Global::argv > 1) {
> as before
>
> Then I could call as SSI or even command line for caching:
> appserver -a asdf -b asdf -c asdf -d asdf -e etc...
>
> Looks too easy. Has anyone any experience going down this
> path before? There are a lot of other ways vlink could tell
> server how it is being called.
Probably the easiest is in the environment. You can tell
IC which environment variables to pass through in interchange.cfg.
Right now it only looks for MOD_PERL in the distribution
configuration.
Environment MOD_PERL
You could change that to:
Environment ARG1 ARG2 ARG3
etc.
--
Mike Heins
Perusion -- Expert Interchange Consulting http://www.perusion.com/
phone +1.513.523.7621 <mike@perusion.com>
People who want to share their religious views with you
almost never want you to share yours with them. -- Dave Barry