Gossamer Forum
Home : Products : Gossamer Links : Discussions :

fcgi for a simple task in a standalone script possible ?

Quote Reply
fcgi for a simple task in a standalone script possible ?
 



Hi friends


let us say i have a standalone code displays latest 5 submission which print out a page corrrectly
will it wij corrrectly if i put it into fcgi loop?? (as i try to use fcgi)

did anyone has ever try it?

the only information i found is
http://www.gossamer-threads.com/forum/Products_C9/Gossamer_Links_C5/Discussions_F18/Re:_[dan]_LSQL_under_FastCGI_P175226/?search_string=Links-%3Ereset_env#p175226


Quote:

No, its never been tested under FastCGI. Remarkably, we've never had a client using it, it's always been mod_perl or SpeedyCGI. I don't think it would be too hard, you would just want to do:

while (...) {
$GT::Base::PERSIST = 1;
Links->reset_env;
main();
}

and it should work fine.

Cheers,

Alex
--




So if that is the case would it be workable?
it seems it include everything into the while loop
database connection and template parsing. would that be the right way to use fcgi?


Thanks you very much folks in advance


Code:
blah blah blah blah blah blah blah blah
 use FCGI;

 while(FCGI::accept() >=0 )
  {
  $GT::Base::PERSIST = 1;
Links->reset_env;
latest_5submission();
  }
 exit 0;



sub latest_5submission {
my ($sth,$tab,$output);
$tab = $DB->table('table1');

blah blah
$error = $GT::SQL::error;
blah blah blah

output .= Links::SiteHTML::display ('latest_5submission', $link);

};
Subject Author Views Date
Thread fcgi for a simple task in a standalone script possible ? courierb 2434 Mar 4, 2010, 8:50 PM
Post Re: [courierb] fcgi for a simple task in a standalone script possible ?
courierb 2351 Mar 4, 2010, 9:31 PM