Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 23f79a87

Von Moritz Bunkus vor etwa 14 Jahren hinzugefügt

  • ID 23f79a876613fabf7f4aa2de230788ebeb840de9
  • Vorgänger f89d3512
  • Nachfolger 7a0da5ac

Umstellung des Dispatcher-Moduls auf Objekt-Aufrufsyntax

Unterschiede anzeigen:

SL/Dispatcher.pm
# number 'die' was called in.
use constant END_OF_REQUEST => "END-OF-REQUEST\n";
sub new {
my ($class, $interface) = @_;
my $self = bless {}, $class;
$self->{interface} = lc($interface || 'cgi');
return $self;
}
sub pre_request_checks {
if (!$::auth->session_tables_present) {
if ($::form->{script} eq 'admin.pl') {
......
}
sub handle_request {
my $self = shift;
$::lxdebug->enter_sub;
$::lxdebug->begin_request;
my $interface = lc(shift || 'cgi');
my ($script, $path, $suffix, $script_name, $action, $routing_type);
$script_name = $ENV{SCRIPT_NAME};
unrequire_bin_mozilla($interface);
$self->unrequire_bin_mozilla;
$::cgi = CGI->new('');
$::locale = Locale->new($::language);
......
}
sub unrequire_bin_mozilla {
return unless $_[0] =~ m/^(?:fastcgi|fcgid|fcgi)$/;
my $self = shift;
return unless $self->{interface} =~ m/^(?:fastcgi|fcgid|fcgi)$/;
for (keys %INC) {
next unless m#^bin/mozilla/#;
admin.pl
use SL::Dispatcher;
SL::Dispatcher::pre_startup();
SL::Dispatcher::handle_request('CGI');
my $dispatcher = SL::Dispatcher->new('CGI');
$dispatcher->pre_startup;
$dispatcher->handle_request;
1;
dispatcher.fpl
SL::FCGIFixes::apply_fixes();
SL::Dispatcher::pre_startup();
my $dispatcher = SL::Dispatcher->new('FastCGI');
$dispatcher->pre_startup;
my $request = FCGI::Request();
SL::Dispatcher::handle_request('FastCGI') while $request->Accept() >= 0;
$dispatcher->handle_request($request) while $request->Accept() >= 0;
1;

Auch abrufbar als: Unified diff