Changeset 229

Show
Ignore:
Timestamp:
04/08/07 04:22:39 (2 years ago)
Author:
ingy
Message:
 r3828@dhcp199:  ingy | 2007-04-08 20:21:46 +0900
 simple server working in kwikis by default.
 
 seeing bugs with the server though.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/core/Kwiki/kwiki

    r198 r229  
    5555use lib grep { -e } split /:/, $ENV{KWIKI_LIB_PATH} || 'lib'; 
    5656use Kwiki::Boot; 
    57 Kwiki::Boot->boot->main->hub->command->process(@ARGV)->hub->remove_hooks; 
     57Kwiki::Boot->boot->cli_config->main->hub->command->process(@ARGV)->hub->remove_hooks; 
    5858 
    5959__END__ 
  • trunk/src/core/Kwiki/lib/Kwiki/Boot/V1.pm

    r198 r229  
    3535    $self->SUPER::add_default_classes($default); 
    3636} 
     37 
     38sub cli_config { 
     39    push @{$self->config->plugin_classes}, 'Kwiki::Simple::Server::HTTP'; 
     40    return $self; 
     41} 
  • trunk/src/cpan/modules.mk

    r226 r229  
    99        IO \ 
    1010        IO/Capture \ 
     11        MIME \ 
    1112        Pod \ 
    1213        Pod/Simple \ 
     
    2627        File/MMagic.pm \ 
    2728        IO/Capture.pm \ 
     29        MIME/Type.pm \ 
     30        MIME/Types.pm \ 
    2831        Pod/Escapes.pm \ 
    2932        Pod/Simple.pm \ 
  • trunk/src/plugins/cpan/HTTP-Server-Simple-Kwiki-0.29/lib/HTTP/Server/Simple/Kwiki.pm

    r118 r229  
    11package HTTP::Server::Simple::Kwiki; 
    22 
     3use lib 'lib'; 
     4use strict; 
     5use warnings; 
    36use HTTP::Server::Simple::CGI; 
    47use HTTP::Server::Simple::Static; 
    58use IO::Capture::Stdout; 
    69use base qw(HTTP::Server::Simple::CGI HTTP::Server::Simple::Static); 
    7 use strict; 
    8 use warnings; 
    9 use Kwiki; 
     10use Kwiki::Boot; 
    1011our $VERSION = 0.29; 
    1112 
     
    1516  my $url = "http://localhost" . $ENV{REQUEST_URI}; 
    1617 
    17   if ($url =~ /\.(gif|png|css)/) { 
     18  if ($url =~ /\.(jpg|gif|png|css|javascript)$/) { 
    1819    $self->serve_static($cgi, "."); 
    1920  } else { 
    2021    my $capture = IO::Capture::Stdout->new(); 
    2122    $capture->start(); 
    22     Kwiki->new->debug->process('config*.*', -plugins => 'plugins')
     23    Kwiki::Boot->debug->boot->kwiki->process
    2324    $capture->stop(); 
    2425    my $output = join '', $capture->read; 
    2526 
    2627    if ($output =~ m{^Status: 302}) { 
    27         warn "302\n$output\n"; 
     28#         warn "302\n$output\n"; 
    2829      $output = "HTTP/1.0 302 OK\r\n$output"; 
    2930    } else { 
    30         warn "2002\n$output\n"; 
     31#         warn "200\n$output\n"; 
    3132      $output = "HTTP/1.0 200 OK\r\n$output"; 
    3233    } 
  • trunk/src/plugins/cpan/Kwiki-Simple-Server-HTTP-0.03/lib/Kwiki/Simple/Server/HTTP.pm

    r87 r229  
    1616sub handle_start { 
    1717    my $port = shift || $self->hub->config->simple_server_http_port; 
     18    $self->destroy_hub; 
    1819    my $server = HTTP::Server::Simple::Kwiki->new($port); 
    1920    $server->run();