You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axkit-dev@xml.apache.org by ma...@sergeant.org on 2006/08/07 16:44:02 UTC

[SVN] [55] Remove print() debugging from gallery

Revision: 55
Author:   matt
Date:     2006-08-07 14:43:39 +0000 (Mon, 07 Aug 2006)

Log Message:
-----------
Remove print() debugging from gallery
Don't use local_addr_string to get the port as it's only in Danga::Socket SVN.

Modified Paths:
--------------
    trunk/lib/AxKit2/Config/Location.pm
    trunk/plugins/demo/gallery

Modified: trunk/lib/AxKit2/Config/Location.pm
===================================================================
--- trunk/lib/AxKit2/Config/Location.pm	2006-08-07 00:44:28 UTC (rev 54)
+++ trunk/lib/AxKit2/Config/Location.pm	2006-08-07 14:43:39 UTC (rev 55)
@@ -5,6 +5,8 @@
 use strict;
 use warnings;
 
+our $AUTOLOAD;
+
 sub new {
     my $class = shift;
     my $server = shift;
@@ -80,4 +82,14 @@
                    $self->server->notes($key);
 }
 
+sub DESTROY {}
+
+sub AUTOLOAD {
+    my $self = shift;
+    my $method = $AUTOLOAD;
+    $method =~ s/.*:://;
+    print "AUTOLOAD: $method\n";
+    $self->server->$method(@_);
+}
+
 1;
\ No newline at end of file

Modified: trunk/plugins/demo/gallery
===================================================================
--- trunk/plugins/demo/gallery	2006-08-07 00:44:28 UTC (rev 54)
+++ trunk/plugins/demo/gallery	2006-08-07 14:43:39 UTC (rev 55)
@@ -84,7 +84,6 @@
     # If the size is 'full' then we're sending back the full size
     # image.  There's no work to do, so just return DECLINED
     if ($size eq 'full') {
-        print "Returning full file\n";
         open(my $fh, $file) || die "open($file): $!";
         $client->headers_out->header('Content-Length', -s $file);
         $client->headers_out->header('Content-Type', $ct);
@@ -200,7 +199,6 @@
     my ($prev, $next);
     my $found = 0;
     while (my $entry = readdir(DIR)) {
-        print "Entry: $entry\n";
         next if $entry =~ /^\./;
         next if -d $entry;
         if ($entry eq $file) {
@@ -208,7 +206,6 @@
             next;
         }
         my $type = $mm->checktype_filename("$path/$entry");
-        print "$entry is of type: $type\n";
         next unless $type =~ /^image\//;
         if ($found) {
             $next = $entry;
@@ -471,13 +468,11 @@
     
     # scrub files we don't want (dot-files)
     for my $node ($xc->findnodes('//axdir:file[starts-with(text(), ".")]')) {
-        print "Found dot-dir\n";
         $node->parentNode->removeChild($node);
     }
     
     # scrub dot-dirs
     for my $node ($xc->findnodes('//axdir:directory[starts-with(text(), ".")]')) {
-        print "Found dot-dir\n";
         $node->parentNode->removeChild($node);
     }
     
@@ -560,7 +555,7 @@
 
 	my $config_xml = "<perl-vars>\n";
 	foreach my $variable (@variables) {
-        $config_xml .= "<var name='$variable'>" . $self->get_cfg($variable) . "</var>\n";
+        $config_xml .= "<var name='$variable'>" . ($self->get_cfg($variable) || '') . "</var>\n";
 	}
     
     my $sizelist = $self->get_cfg('GallerySizes');
@@ -575,9 +570,9 @@
     $config_xml .= "</GallerySizes>\n";
     
     my $hostname = $self->client->headers_in->header('Host') || 'localhost';
+    $hostname =~ s/:\d+$//;
     my $site = "http://$hostname";
-    my $port = $self->client->local_addr_string;
-    $port =~ s/.*://;
+    my $port = $self->config->port;
     
     $config_xml .= <<EOXML;
 <server>
@@ -587,8 +582,6 @@
 </server>
 EOXML
     
-    print "Parsing: $config_xml\n";
-    
     $dom->documentElement->firstChild->appendWellBalancedChunk($config_xml);
     
     XML::LibXSLT->register_function("urn:ax-app-gallery", "epoch-to-date",