/[suikacvs]/webroot/swe/lib/SWE/DB/SuikaWiki3LastModified.pm
Suika

Contents of /webroot/swe/lib/SWE/DB/SuikaWiki3LastModified.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Mon Mar 2 07:32:30 2009 UTC (16 years, 1 month ago) by wakaba
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
Error occurred while calculating annotation data.
++ swe/lib/SWE/DB/ChangeLog	2 Mar 2009 07:32:02 -0000
2009-03-01  Wakaba  <wakaba@suika.fam.cx>

	* HashedIndex.pm: New module.

	* IDGenerator.pm (get_last_id): New method.

2009-01-12  Wakaba  <wakaba@suika.fam.cx>

	* SuikaWiki3LastModified.pm (get_data): Why this convertion was
	necessary?

++ swe/lib/suikawiki/ChangeLog	2 Mar 2009 07:31:08 -0000
2009-03-02  Wakaba  <wakaba@suika.fam.cx>

	* main.pl (;search, ;terms): New modes.

++ swe/styles/ChangeLog	3 Feb 2009 03:44:04 -0000
2009-02-03  Wakaba  <wakaba@suika.fam.cx>

	* sw.css: Fixed a typo.

1 package SWE::DB::SuikaWiki3LastModified;
2 use strict;
3
4 require Encode::EUCJPSW;
5
6 sub new ($) {
7 my $self = bless {
8 file_name => 'lastmodified.dat',
9 }, shift;
10 } # new
11
12 sub _load_data ($) {
13 my $self = shift;
14
15 open my $file, '<', $self->{file_name} or die "$0: $self->{file_name}: $!";
16 local $/ = undef;
17 my $val = <$file>;
18 close $file;
19
20 if ($val =~ s!^\#\?SuikaWikiMetaInfo/0.9[^\x02]*\x02!!s) {
21 $self->{data} = {map {(Encode::decode ('euc-jp-sw', $_->[0]), $_->[1])}
22 map {[split /\x1F/, $_, 2]} split /\x1E/, $val};
23 }
24
25 $self->{data_loaded} = 1;
26 } # _load_data
27
28 sub get_data ($$) {
29 my ($self, $page_name) = @_;
30 $self->_load_data unless $self->{data_loaded};
31
32 # $page_name =~ s/ /\x2F\x2F/g;
33 return $self->{data}->{$page_name};
34 } # get_data
35
36 1;

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24