AddressBook

 view release on metacpan or  search on metacpan

lib/AddressBook/DB/DBI.pm  view on Meta::CPAN

169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
    $entry->{timestamp} = $self->_get_timestamp;
    return $entry;
  }
  return undef;
}
 
sub _get_timestamp {
  my $self = shift;
  my $class = ref $self || croak "Not a method call";
  if ($self->{dbi_driver} =~ /^CSV/) {
    my @stat = stat($self->{dbh}->{f_dir} . "/" . $self->{table});
    return ParseDateString("epoch $stat[9]");
  } else {
    croak "Error: Don't know how to determine timestamp for this database type";
  }
}
 
sub reset {
  my $self = shift;
  my $class = ref $self || croak "Not a method call";
  $self->search;

lib/AddressBook/DB/LDIF.pm  view on Meta::CPAN

149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
  my %attr = %{$entry->get(db=>$self->{db_name},values_only=>'1')};
  ($dn_calculate=$self->{dn_calculate}) =~ s/\$(\w*)/\$attr{$1}->[0]/g;
  eval qq{\$dn = $dn_calculate}; warn "Syntax error in dn_calculate: $@" if $@;
  $dn .= "," . $self->{base};
  return $dn;
}
 
sub _get_timestamp {
  my $self = shift;
  my $class = ref $self || croak "Not a method call";
  my @stat = stat($self->{filename});
  return ParseDateString("epoch $stat[9]");
}
 
1;
 
=head2 Timestamps
 
For syncronization purposes, all records are timestamped with the modification date
of the LDIF file.



( run in 0.331 second using v1.01-cache-2.11-cpan-4e96b696675 )