/[pxelator]/lib/PXElator/CouchDB.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/PXElator/CouchDB.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 209 by dpavlin, Thu Aug 13 00:06:48 2009 UTC revision 210 by dpavlin, Thu Aug 13 12:00:38 2009 UTC
# Line 80  sub put { Line 80  sub put {
80                  $rev->{$url} = $json->{_rev} = $old if defined $old;                  $rev->{$url} = $json->{_rev} = $old if defined $old;
81          }          }
82    
83          $json = unbless dclone $json if blessed $json;          my $data = dclone $json;
84            $data = unbless $data if blessed $data;
85    
86          $json = JSON->new->utf8->encode( $json ) if $json;          warn dump( $data );
87    
88          $self->request(PUT => $url, $json);          $json = JSON->new->utf8->encode( $data );
89    
90            warn $json;
91    
92            do {
93                    eval { $self->request(PUT => $url, $json) };
94                    $rev->{$url} = $self->get( $url )->{_rev} if $@;
95            } until ! $@;
96  }  }
97    
98  sub post {  sub post {
# Line 103  sub audit { Line 111  sub audit {
111          $url =~ s/\W+/-/g;          $url =~ s/\W+/-/g;
112    
113          my ( $package, $file, $line, $sub ) = caller(1);          my ( $package, $file, $line, $sub ) = caller(1);
114          ( $package, undef, $line ) = caller(0) if $package eq 'main';  #       ( $package, undef, $line ) = caller(0) if $package eq 'main';
115    
116          my $time = time();          my $time = time();
117    
# Line 113  sub audit { Line 121  sub audit {
121    
122          $time = int($time); # reduce granularity          $time = int($time); # reduce granularity
123          $audit->put( "pxelator/$time.$package.$url", $data );          $audit->put( "pxelator/$time.$package.$url", $data );
124    
125  }  }
126    
127  1;  1;

Legend:
Removed from v.209  
changed lines
  Added in v.210

  ViewVC Help
Powered by ViewVC 1.1.26