hi all...
sorry about always talking about the mundane 1.3 stuff, but...
based on this comment by Doug:
http://marc.theaimsgroup.com/?l=apache-modperl&m=94148186408430&w=2
I was able to come up with the below module that allows you to use
Apache::Util outside of Apache.
So, my questions are:
will the ap/apr split make this type of thing unnecessary in 2.0?
then (if you have the tuits)
is this approach reasonable?
not being too familiar with shared objects, does it make sense that
some of the functions core dump - it seems to be any that call ap_palloc
thanks
--Geoff
package ExportUtil;
use DynaLoader;
use Exporter;
use strict;
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(unescape_uri unescape_uri_info escape_html
validate_password size_string);
# these dump core
our @EXPORT_NOT_OK = qw(escape_uri ht_time parsedate);
# load the shared object file
my $libref =
DynaLoader::dl_load_file("/usr/local/apache/libexec/libhttpd.so");
# find the symbol table
my $symref = DynaLoader::dl_find_symbol($libref, "boot_Apache__Util");
# install the code reference to Apache::Util::bootstrap
my $coderef = DynaLoader::dl_install_xsub("Apache::Util::bootstrap",
$symref);
# call Apache::Util::bootstrap
&{$coderef};
# now do the same for the Apache class to get at
# unescape_uri and unescape_url
$symref = DynaLoader::dl_find_symbol($libref, "boot_Apache");
# install the code reference to Apache::bootstrap
$coderef = DynaLoader::dl_install_xsub("Apache::bootstrap",
$symref);
# call Apache::bootstrap
&{$coderef};
# now we can use our class
use Apache::Util qw(unescape_uri unescape_uri_info escape_html
validate_password size_string);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]