Sunday, May 20, 2007

Foorum v0.03

I just release another version of Foorum at http://code.google.com/p/fayland.

CHANGES:
- remove Plugin::Email. insert into table scheduled_email and use a cron script to send. (19/5/2007)
- remove Plugin::Scheduler. all cron scripts goes to /bin/cron (19/5/2007)
- bug fixes (19/5/2007)

I remove the Email Plugin and create a new table scheduled_email to contain the email content, then use /bin/cron/send_scheduled_email to send emails

and remove the Scheduler. I think crontab is better

and remove such files can reduce the memory usage under mod_perl I think

http://fayland.googlecode.com/files/Foorum-0.03.tar.gz

Enjoy!

Labels:

Sunday, May 13, 2007

Amazing Danga

mm, after read the pdf of http://www.danga.com/words/2007_04_linuxfest_nw/linuxfest.pdf, I find myself really excited with the technology of Danga (now a part of Six Apart).

we use a lot of memcached in Zorpia.
but other technology like MogileFS, Perlbal and Gearman are TRULY exciting too.

I spent my whole weekend to try them and found that I do need recommend them. :)
Tuesday, May 08, 2007

Foorum v0.02

I just release the new version of Foorum v0.02 at http://code.google.com/p/fayland/.

no big changes. u can download it from http://fayland.googlecode.com/files/Foorum-0.02.tar.gz

Thanks.

Labels:

Monday, May 07, 2007

Catalyst PageCache with I18N

well, I have something like as follows in the Foorum Root.pm sub auto:
 # internationalization
$c->stash->{lang} = $c->req->cookie('pref_lang')->value if ($c->req->cookie('pref_lang'));
$c->stash->{lang} ||= $c->user->lang if ($c->user_exists);
$c->stash->{lang} ||= $c->config->{default_pref_lang};
if (my $lang = $c->req->param('set_lang')) {
$lang =~ s/\W+//isg;
if (length($lang) == 2) {
$c->res->cookies->{pref_lang} = { value => $lang };
$c->stash->{lang} = $lang;
}
}
$c->languages( [ $c->stash->{lang} ] );

but the Catalyst::Plugin::PageCache does NOT get along well with the I18N's languages.

so that I patch this module for a bit. to create a new plugin based on that:
package Catalyst::Plugin::PageCacheWithI18N;

use strict;
use warnings;
use Class::C3;
use vars qw/$VERSION/;
$VERSION = '0.01';
use base qw/Catalyst::Plugin::PageCache/;

sub _get_page_cache_key {
my ($c) = @_;

my $key = $c->next::method(@_);
my $lang = $c->req->cookie('pref_lang')->value if ($c->req->cookie('pref_lang'));
$lang ||= $c->user->lang if ($c->user_exists);
$lang ||= $c->config->{default_pref_lang};
if (my $set_lang = $c->req->param('set_lang')) {
$set_lang =~ s/\W+//isg;
if (length($set_lang) == 2) {
$lang = $set_lang;
}
}
$key .= '#' . $lang if ($lang);
return $key;
}

1;


Links: http://fayland.googlecode.com/svn/trunk/Foorum/lib/Catalyst/Plugin/PageCacheWithI18N.pm

Labels: , ,