Revision: 94 Author: matt Date: 2006-08-16 18:03:27 +0000 (Wed, 16 Aug 2006)
Log Message: ----------- A few debug fixes, plus lazy module loading for transformers Modified Paths: -------------- trunk/lib/AxKit2/Processor.pm trunk/lib/AxKit2/Server.pm trunk/plugins/demo/gallery trunk/plugins/dir_to_xml trunk/plugins/serve_file Modified: trunk/lib/AxKit2/Processor.pm =================================================================== --- trunk/lib/AxKit2/Processor.pm 2006-08-16 17:51:59 UTC (rev 93) +++ trunk/lib/AxKit2/Processor.pm 2006-08-16 18:03:27 UTC (rev 94) @@ -9,10 +9,6 @@ our @EXPORT = qw(XSP XSLT TAL XPathScript); use XML::LibXML; -use AxKit2::Transformer::XSP; -use AxKit2::Transformer::XSLT; -use AxKit2::Transformer::TAL; -use AxKit2::Transformer::XPathScript; our $parser = XML::LibXML->new(); @@ -118,22 +114,26 @@ sub XSP { die "XSP takes no arguments" if @_; + require AxKit2::Transformer::XSP; return AxKit2::Transformer::XSP->new(); } sub XSLT { my $stylesheet = shift || die "XSLT requires a stylesheet"; + require AxKit2::Transformer::XSLT; return AxKit2::Transformer::XSLT->new($stylesheet, @_); } sub TAL { my $stylesheet = shift || die "TAL requires a stylesheet"; + require AxKit2::Transformer::TAL; return AxKit2::Transformer::TAL->new($stylesheet); } sub XPathScript { my $stylesheet = shift || die "XPathScript requires a stylesheet"; + require AxKit2::Transformer::XPathScript; my $output_style = shift; return AxKit2::Transformer::XPathScript->new($stylesheet, $output_style); } Modified: trunk/lib/AxKit2/Server.pm =================================================================== --- trunk/lib/AxKit2/Server.pm 2006-08-16 17:51:59 UTC (rev 93) +++ trunk/lib/AxKit2/Server.pm 2006-08-16 18:03:27 UTC (rev 94) @@ -29,9 +29,7 @@ my $csock = $sock->accept; return unless $csock; - if ($::DEBUG) { - AxKit2::Client->log(LOGDEBUG, "Listen child making a AxKit2::Connection for ", fileno($csock)); - } + AxKit2::Client->log(LOGDEBUG, "Listen child making a AxKit2::Connection for ", fileno($csock)); IO::Handle::blocking($csock, 0); setsockopt($csock, IPPROTO_TCP, TCP_NODELAY, pack("l", 1)) or die; Modified: trunk/plugins/demo/gallery =================================================================== --- trunk/plugins/demo/gallery 2006-08-16 17:51:59 UTC (rev 93) +++ trunk/plugins/demo/gallery 2006-08-16 18:03:27 UTC (rev 94) @@ -535,11 +535,8 @@ for my $node ($dom->findnodes('//images/image'), $dom->findnodes('//albums/album')) { - $self->log(LOGINFO, "got an " . $node->nodeName); my $filename = $node->findnodes('./filename/text()'); - $self->log(LOGINFO, "filename = $filename"); my $fullpath = catfile($dirpath, "$filename"); - $self->log(LOGINFO, "fullpath = $fullpath"); my $ct = $mm->checktype_filename($fullpath); $node->appendWellBalancedChunk(<<EOXML); <dirpath>$dirpath</dirpath> Modified: trunk/plugins/dir_to_xml =================================================================== --- trunk/plugins/dir_to_xml 2006-08-16 17:51:59 UTC (rev 93) +++ trunk/plugins/dir_to_xml 2006-08-16 18:03:27 UTC (rev 94) @@ -74,6 +74,7 @@ $xmlline =~ s/&/&/; $xmlline =~ s/</</; my @stat = stat(catfile($dir,$line)); + no warnings 'uninitialized'; my $attr = "size=\"$stat[7]\" atime=\"$stat[8]\" mtime=\"$stat[9]\" ctime=\"$stat[10]\""; $attr .= ' readable="1"' if (-r _); $attr .= ' writable="1"' if (-w _); Modified: trunk/plugins/serve_file =================================================================== --- trunk/plugins/serve_file 2006-08-16 17:51:59 UTC (rev 93) +++ trunk/plugins/serve_file 2006-08-16 18:03:27 UTC (rev 94) @@ -35,6 +35,7 @@ $self->client->watch_read(0); my $file = $hd->filename; + $self->log(LOGINFO, "Serving file: $file"); if (open(my $fh, $file)) { $self->client->write("HTTP/1.1 200 OK Date: Mon, 24 Jul 2006 23:59:39 GMT