Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Akira Sawada committed Feb 22, 2012
1 parent 6708edf commit 70702b9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mt.psgi
Expand Up @@ -153,15 +153,17 @@ my %CGI_SCRIPTS = (
wizard => 'mt-wizard.cgi',
check => 'mt-check.cgi', # TBD: This will fail since no entry is in core registry.
upgrade => MT->config->UpgradeScript,
xmlrpc => MT->config->XMLRPCScript,
xmlrpc => MT->config->XMLRPCScript,
);

my $urlmap = Plack::App::URLMap->new;
for my $id ( keys %DAEMON_SCRIPTS ) {
my $app = MT->registry( applications => $id ) or next;
my $handler = $app->{handler};
my $path = $DAEMON_SCRIPTS{$id};
my $base = $id eq 'cms' ? MT->config->AdminCGIPath : MT->config->CGIPath;
my $base = $id eq 'cms' ? MT->config->AdminCGIPath || MT->config->CGIPath
: MT->config->CGIPath
;
$base =~ s!^https?://[^/]*/!/!;
$base .= '/' unless $base =~ m!/$!;
$path = $base . $path;
Expand All @@ -176,4 +178,5 @@ for my $id ( keys %CGI_SCRIPTS ) {
my $filepath = File::Spec->catfile( $FindBin::Bin, $file );
$urlmap->map( $url, $mt_cgi->( $filepath ) );
}

$urlmap->to_app;

0 comments on commit 70702b9

Please sign in to comment.