move plp server handlers to respective modules
[perl/plp/.git] / PLP / Apache.pm
index 217546fbe1abae70c64e711694d7722fc4aa97ce..a18ed258de4d03f20b95ddf28a481bf2b7f09f51 100644 (file)
@@ -4,6 +4,9 @@ use strict;
 
 our $VERSION = '1.00';
 
+use PLP;
+require Apache::Constants;
+
 # mod_perl initializer: returns 0 on success, Apache error code on failure
 sub init {
        our $r = shift;
@@ -39,5 +42,17 @@ sub print {
        $PLP::Apache::r->print(@_);
 }
 
+# This is the mod_perl handler.
+sub handler {
+       PLP::clean();
+       if (my $ret = init($_[0])) {
+               return $ret;
+       }
+       #S PLP::start($_[0]);
+       PLP::start();
+       no strict 'subs';
+       return Apache::Constants::OK();
+}
+
 1;