summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-10-31 09:04:18 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-10-31 09:04:18 +0800
commitb9fba8c42579f24c7ea5f2c93d06e660fd30b83c (patch)
tree260d974a7d5c908053a7b4a7071c40c1124697a8
parentbc28ade807e938c4bdde8c20ca91f7ae43a3d698 (diff)
downloadpttbbs-b9fba8c42579f24c7ea5f2c93d06e660fd30b83c.tar
pttbbs-b9fba8c42579f24c7ea5f2c93d06e660fd30b83c.tar.gz
pttbbs-b9fba8c42579f24c7ea5f2c93d06e660fd30b83c.tar.bz2
pttbbs-b9fba8c42579f24c7ea5f2c93d06e660fd30b83c.tar.lz
pttbbs-b9fba8c42579f24c7ea5f2c93d06e660fd30b83c.tar.xz
pttbbs-b9fba8c42579f24c7ea5f2c93d06e660fd30b83c.tar.zst
pttbbs-b9fba8c42579f24c7ea5f2c93d06e660fd30b83c.zip
add loadSerialized
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@1282 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rwxr-xr-xpttbbs/blog/blog.pl15
1 files changed, 15 insertions, 0 deletions
diff --git a/pttbbs/blog/blog.pl b/pttbbs/blog/blog.pl
index 6b75bc15..dcb272c7 100755
--- a/pttbbs/blog/blog.pl
+++ b/pttbbs/blog/blog.pl
@@ -14,6 +14,7 @@ use DBD::mysql;
use POSIX;
use MD5;
use Mail::Sender;
+use Data::Serializer;
use vars qw/@emonth @cnumber %config %attr %article %th $dbh $brdname/;
@@ -308,6 +309,20 @@ $comment
});
}
+ # serialized -------------------------------------------------------------
+ if( $attr{"$fn.loadSerialized"} ){
+ my($obj, %h, $str);
+ $obj = Data::Serializer->new(serializer => 'Storable',
+ digester => 'MD5',
+ compress => 0,
+ );
+ open FH, '<'.$attr{"$fn.loadSerialized"};
+ FH->read($str, 104857600);
+ close FH;
+ %h = %{$obj->deserialize($str)};
+ $th{$_} = $h{$_} foreach( keys %h );
+ }
+
# ¥Î Template Toolkit ¿é¥X
mkdir "$BLOGCACHE/$brdname";
$tmpl = Template->new({INCLUDE_PATH => '.',