cvsuser 03/12/03 08:21:11
Modified: App-Context/lib/App/Context Cmd.pm HTTP.pm NetServer.pm
SimpleServer.pm
Log:
options
Revision Changes Path
1.4 +12 -12 p5ee/App-Context/lib/App/Context/Cmd.pm
Index: Cmd.pm
===================================================================
RCS file: /cvs/public/p5ee/App-Context/lib/App/Context/Cmd.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -r1.3 -r1.4
--- Cmd.pm 19 May 2003 17:41:12 -0000 1.3
+++ Cmd.pm 3 Dec 2003 16:21:11 -0000 1.4
@@ -1,6 +1,6 @@
#############################################################################
-## $Id: Cmd.pm,v 1.3 2003/05/19 17:41:12 spadkins Exp $
+## $Id: Cmd.pm,v 1.4 2003/12/03 16:21:11 spadkins Exp $
#############################################################################
package App::Context::Cmd;
@@ -56,12 +56,12 @@
=cut
-sub execute_event {
+sub _execute_event {
my ($self) = @_;
- my $initconf = $self->initconf();
+ my $options = $self->options();
- if ($#ARGV == -1 || $initconf->{"?"} || $initconf->{help}) {
+ if ($#ARGV == -1 || $options->{"?"} || $options->{help}) {
$self->_print_usage();
exit(0);
}
@@ -70,23 +70,23 @@
my $curr_name_new = 0;
- $curr_service = $initconf->{service} || "SessionObject";
+ $curr_service = $options->{service} || "SessionObject";
if ($#ARGV > -1 && $ARGV[0] =~ /^[A-Z]/) {
$curr_service = shift @ARGV;
}
- $curr_returntype = $initconf->{returntype} || "default";
+ $curr_returntype = $options->{returntype} || "default";
if ($#ARGV > -1 && $ARGV[$#ARGV] =~ /^:(.+)/) {
$curr_returntype = $1;
pop(@ARGV);
}
- $curr_name = $initconf->{name} || "default";
+ $curr_name = $options->{name} || "default";
if ($#ARGV > -1) {
$curr_name = shift @ARGV;
}
- $curr_method = $initconf->{method} || "content";
+ $curr_method = $options->{method} || "content";
$curr_method =~ /(.*)/;
$curr_method = $1;
@@ -125,7 +125,7 @@
}
}
else {
- $curr_args = $initconf->{args} || "";
+ $curr_args = $options->{args} || "";
}
# $self->so_set("default", "curr_service", $curr_service);
@@ -169,12 +169,12 @@
sub _print_usage {
print STDERR
"--------------------------------------------------------------------\n";
print STDERR "Usage: $0 [options] [<Service>] <name> [<method> [<args>]]
[:returntype]\n";
- print STDERR " --conf_tag=<tag> default basename of initconf/conf
file (files not specified)\n";
- print STDERR " --initconf=<file> initialization config file
(override any default searching)\n";
+ print STDERR " --app=<tag> default basename of options file
(when file not specified)\n";
+ print STDERR " --config_file=<file> initialization config file
(override any default searching)\n";
print STDERR " --prefix=<dir> base directory of installed
software (i.e. /usr/local)\n";
print STDERR " --debugconf debug the configuration process\n";
print STDERR " --perlinc=<dirlist> directories to add to [EMAIL
PROTECTED] to find perl modules\n";
- print STDERR " --import=<filelist> additional initconf files to
read\n";
+ print STDERR " --import=<filelist> additional config files to read\n";
print STDERR " --debug=<level> set debug level, default=0\n";
print STDERR " --context_class=<class> class,
default=App::Context::Cmd\n";
print STDERR " --help or -? print this message\n";
1.6 +7 -7 p5ee/App-Context/lib/App/Context/HTTP.pm
Index: HTTP.pm
===================================================================
RCS file: /cvs/public/p5ee/App-Context/lib/App/Context/HTTP.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -r1.5 -r1.6
--- HTTP.pm 29 Apr 2003 19:46:31 -0000 1.5
+++ HTTP.pm 3 Dec 2003 16:21:11 -0000 1.6
@@ -1,6 +1,6 @@
#############################################################################
-## $Id: HTTP.pm,v 1.5 2003/04/29 19:46:31 spadkins Exp $
+## $Id: HTTP.pm,v 1.6 2003/12/03 16:21:11 spadkins Exp $
#############################################################################
package App::Context::HTTP;
@@ -140,9 +140,9 @@
my ($request);
eval {
- $request = $self->request();
- $request->process();
- $self->send_response();
+ $request = $self->request(); # get the request
+ $request->process(); # process it
+ $self->send_response(); # send a response
};
if ($@) {
print <<EOF;
@@ -209,7 +209,7 @@
}
eval {
- $self->{request} = App->new($request_class, "new", $self,
$self->{initconf});
+ $self->{request} = App->new($request_class, "new", $self, $self->{options});
};
$self->add_message("Context::HTTP::request(): $@") if ($@);
@@ -248,7 +248,7 @@
my $response_class = $self->iget("response_class", "App::Response");
eval {
- $self->{response} = App->new($response_class, "new", $self,
$self->{initconf});
+ $self->{response} = App->new($response_class, "new", $self,
$self->{options});
};
$self->add_message("Context::HTTP::response(): $@") if ($@);
@@ -295,7 +295,7 @@
delete $self->{headers}
}
- if ($self->{initconf}{gzip}) {
+ if ($self->{options}{gzip}) {
my $user_agent = $self->user_agent();
my $gzip_ok =
$user_agent->supports("http.header.accept-encoding.x-gzip");
1.5 +3 -3 p5ee/App-Context/lib/App/Context/NetServer.pm
Index: NetServer.pm
===================================================================
RCS file: /cvs/public/p5ee/App-Context/lib/App/Context/NetServer.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -r1.4 -r1.5
--- NetServer.pm 22 Mar 2003 04:04:35 -0000 1.4
+++ NetServer.pm 3 Dec 2003 16:21:11 -0000 1.5
@@ -1,6 +1,6 @@
#############################################################################
-## $Id: NetServer.pm,v 1.4 2003/03/22 04:04:35 spadkins Exp $
+## $Id: NetServer.pm,v 1.5 2003/12/03 16:21:11 spadkins Exp $
#############################################################################
package App::Context::NetServer;
@@ -253,7 +253,7 @@
}
eval {
- $self->{request} = App->new($request_class, "new", $self,
$self->{initconf});
+ $self->{request} = App->new($request_class, "new", $self, $self->{options});
};
$self->add_message("Context::NetServer::request(): $@") if ($@);
@@ -292,7 +292,7 @@
my $response_class = $self->iget("response_class", "App::Response");
eval {
- $self->{response} = App->new($response_class, "new", $self,
$self->{initconf});
+ $self->{response} = App->new($response_class, "new", $self,
$self->{options});
};
$self->add_message("Context::NetServer::response(): $@") if ($@);
1.4 +3 -75 p5ee/App-Context/lib/App/Context/SimpleServer.pm
Index: SimpleServer.pm
===================================================================
RCS file: /cvs/public/p5ee/App-Context/lib/App/Context/SimpleServer.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -r1.3 -r1.4
--- SimpleServer.pm 22 Mar 2003 04:04:35 -0000 1.3
+++ SimpleServer.pm 3 Dec 2003 16:21:11 -0000 1.4
@@ -1,6 +1,6 @@
#############################################################################
-## $Id: SimpleServer.pm,v 1.3 2003/03/22 04:04:35 spadkins Exp $
+## $Id: SimpleServer.pm,v 1.4 2003/12/03 16:21:11 spadkins Exp $
#############################################################################
package App::Context::SimpleServer;
@@ -162,7 +162,7 @@
my $request_class = $self->iget("request_class", "App::Request");
eval {
- $self->{request} = App->new($request_class, "new", $self,
$self->{initconf});
+ $self->{request} = App->new($request_class, "new", $self, $self->{options});
};
$self->add_message($@) if ($@);
@@ -201,7 +201,7 @@
my $response_class = $self->iget("response_class", "App::Response");
eval {
- $self->{response} = App->new($response_class, "new", $self,
$self->{initconf});
+ $self->{response} = App->new($response_class, "new", $self,
$self->{options});
};
$self->add_message($@) if ($@);
@@ -217,17 +217,6 @@
=cut
#############################################################################
-# log()
-#############################################################################
-
-=head2 log()
-
-This method is inherited from
-L<C<App::Context>|App::Context/"log()">.
-
-=cut
-
-#############################################################################
# user()
#############################################################################
@@ -255,67 +244,6 @@
my $self = shift;
return $self->request()->user();
}
-
-#############################################################################
-# config()
-#############################################################################
-
-=head2 config()
-
-This method is inherited from
-L<C<App::Context>|App::Context/"config()">.
-
-=cut
-
-#############################################################################
-# PUBLIC METHODS
-#############################################################################
-
-=head1 Public Methods: Debugging
-
-=cut
-
-#############################################################################
-# dbg()
-#############################################################################
-
-=head2 dbg()
-
-This method is inherited from
-L<C<App::Context>|App::Context/"dbg()">.
-
-=cut
-
-#############################################################################
-# dbgprint()
-#############################################################################
-
-=head2 dbgprint()
-
-This method is inherited from
-L<C<App::Context>|App::Context/"dbgprint()">.
-
-=cut
-
-#############################################################################
-# dbglevel()
-#############################################################################
-
-=head2 dbglevel()
-
-This method is inherited from
-L<C<App::Context>|App::Context/"dbglevel()">.
-
-=cut
-
-#############################################################################
-# dbgscope()
-#############################################################################
-
-=head2 dbgscope()
-
-This method is inherited from
-L<C<App::Context>|App::Context/"dbgscope()">.
=cut