[otrs-cvs] otrs/Kernel/System XML.pm,1.49,1.50

cvs-log at otrs.org cvs-log at otrs.org
Mon Apr 2 13:31:39 GMT 2007


Comments:
Update of /home/cvs/otrs/Kernel/System
In directory lancelot:/tmp/cvs-serv3443/Kernel/System

Modified Files:
	XML.pm 
Log Message:
Fixed bug in cache mechanism of XMLHashGet().

Author: mh

Index: XML.pm
===================================================================
RCS file: /home/cvs/otrs/Kernel/System/XML.pm,v
retrieving revision 1.49
retrieving revision 1.50
diff -C2 -d -r1.49 -r1.50
*** XML.pm	2 Apr 2007 07:38:59 -0000	1.49
--- XML.pm	2 Apr 2007 13:31:33 -0000	1.50
***************
*** 304,308 ****
      my $FileCache = quotemeta("$Param{Type}-$Param{Key}");
      $FileCache = $Self->{CacheDirectory}."xml-storage-$FileCache.cache";
!     if (-e $FileCache && !$Param{Cache}) {
          if (open (IN, "< $FileCache")) {
              my $XMLHashRef;
--- 304,308 ----
      my $FileCache = quotemeta("$Param{Type}-$Param{Key}");
      $FileCache = $Self->{CacheDirectory}."xml-storage-$FileCache.cache";
!     if (-e $FileCache && $Param{Cache}) {
          if (open (IN, "< $FileCache")) {
              my $XMLHashRef;
***************
*** 349,352 ****
--- 349,365 ----
          print STDERR "ERROR: xml.pm $@\n";
      }
+     # write cache file
+     if (!-e $FileCache && $Param{Cache}) {
+         my $Dump = Data::Dumper::Dumper(\@XMLHash);
+         $Dump =~ s/\$VAR1/\$XMLHashRef/;
+         if (open (OUT, "> $FileCache")) {
+             binmode(OUT);
+             print OUT $Dump."\n1;";
+             close (OUT);
+         }
+         else {
+             $Self->{LogObject}->Log(Priority => 'error', Message => "Can't write cache file $FileCache: $!");
+         }
+     }
      return @XMLHash;
  }


More information about the cvs-log mailing list