some bug fixing
added some tests
This commit is contained in:
parent
b70ef9d23a
commit
1ce61982ed
7 changed files with 66 additions and 68 deletions
|
|
@ -181,9 +181,6 @@ sub page {
|
|||
$output = $asset->addMissing($assetUrl);
|
||||
}
|
||||
}
|
||||
if ($output eq "chunked") {
|
||||
$output = undef;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ Package WebGUI::Content::Maintenance;
|
|||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
A content handler that does whatever I tell it to do.
|
||||
A content handler that displays a maintenance page while upgrading.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
|
|
|
|||
|
|
@ -1,63 +0,0 @@
|
|||
package WebGUI::Content::Upgrading;
|
||||
|
||||
=head1 LEGAL
|
||||
|
||||
-------------------------------------------------------------------
|
||||
WebGUI is Copyright 2001-2007 Plain Black Corporation.
|
||||
-------------------------------------------------------------------
|
||||
Please read the legal notices (docs/legal.txt) and the license
|
||||
(docs/license.txt) that came with this distribution before using
|
||||
this software.
|
||||
-------------------------------------------------------------------
|
||||
http://www.plainblack.com info@plainblack.com
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Package WebGUI::Content::Upgrading
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
A content handler that displays a maintenance page when in a special upgrade state.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
use WebGUI::Content::Upgrading;
|
||||
my $output = WebGUI::Content::Upgrading::handler($session);
|
||||
|
||||
=head1 SUBROUTINES
|
||||
|
||||
These subroutines are available from this package:
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 handler ( session )
|
||||
|
||||
The content handler for this package.
|
||||
|
||||
=cut
|
||||
|
||||
sub handler {
|
||||
my ($session) = @_;
|
||||
if ($session->setting->get("specialState") eq "upgrading") {
|
||||
my $output = "";
|
||||
$session->http->sendHeader;
|
||||
open(my $FILE,"<",$session->config->getWebguiRoot."/docs/maintenance.html");
|
||||
while (<$FILE>) {
|
||||
$session->output->print($_);
|
||||
}
|
||||
close($FILE);
|
||||
return "none";
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
|
@ -64,7 +64,10 @@ sub handler {
|
|||
use strict;
|
||||
if ($output) {
|
||||
unless ($output eq "none" || $output eq "redirect") {
|
||||
$session->output->print($output) unless ($output eq "chunked");
|
||||
unless ($output eq "chunked") {
|
||||
$session->http->sendHeader();
|
||||
$session->output->print($output)
|
||||
}
|
||||
if ($session->errorHandler->canShowDebug()) {
|
||||
$session->output->print($session->errorHandler->showDebug(),1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue