mod_perl2 Sql-Ledger handler ---------------------------- Jason Jay Rodrigues This project may be licensed under the terms of the GPL 2.0 or whatever license Sql-Ledger currently uses. VERSION: -------- This is release 0.01-dev. REQUIREMENTS: ------------- * Apache 2 * Mod_Perl 2 Perl packages: * DBI * Apache::DBI * Scalar::Util * IO::String * CGI INSTALLATION: ------------- Place the following in your Apache2 Configuration file: ---8<------ BEGIN APACHE CONFIGRUATION: ----- LoadModule perl_module modules/mod_perl.so PerlSwitches -I/home/sql-ledger/htdocs/ PerlModule Apache::DBI PerlModule SL::Handler SetHandler perl-script PerlOptions +ParseHeaders PerlResponseHandler SL::Handler --->8------ END APACHE CONFIGRUATION: ----- CUSTOM CODE GOTCHAS: -------------------- (or, stuff that bit my custom code) I do a bit of naughty reaching into %main::. w/ SL::Handler, %main:: is empty, and you must look to %SL::base:: for all the goodies that used to be in %main:: For example, I have some code that uses Class::DBI in SL. The setup bit in my DBI base class starts like this: our %myconfig; unless(%main::myconfig) { die "SQL-Ledger authentication and setup must be run first before SLDB::DBI can be loaded. Make sure \%myconfig is available."; } %myconfig = %main::myconfig; SLDB::DBI->connection($myconfig{dbconnect},$myconfig{dbuser},$myconfig{dbpasswd}); To work under SL::Handler and a regular SL installation, I changed it like this: our %myconfig; unless(%main::myconfig || %SL::base::myconfig) { die "SQL-Ledger authentication and setup must be run first before SLDB::DBI can be loaded. Make sure \%myconfig is available."; } %myconfig = (%main::myconfig, %SL::base::myconfig); SLDB::DBI->connection($myconfig{dbconnect},$myconfig{dbuser},$myconfig{dbpasswd}); mod_perl changes the way some perl functions behave, like exec, system, pipes, etc. Please read the documentation available at http://perl.apache.org for more specifics. PERFORMANCE: ------------ See the included bench.pl You'll need LWP to run it. Plain Sql-Ledger: Sql-Ledger + SL::Handler: TODO: ----- * Better documentation. * Benchmark script + reporting