Foorum - forum system based on Catalyst


Foorum documentation Contained in the Foorum distribution.

Index


Code Index:

NAME

Top

Foorum - forum system based on Catalyst

DESCRIPTION

Top

nothing for now.

LIVE DEMO

Top

http://www.foorumbbs.com/

FEATURES

Top

open source

u can FETCH all code from http://github.com/fayland/foorum/tree any time any where.

Win32 compatibility

Linux/Unix/Win32 both OK.

templates

use Template for UI.

built-in cache

use Cache::Memcached or use Cache::FileCache or others;

reliable job queue

use TheSchwartz::Moosified

Multi Formatter

HTML::BBCode, Text::Textile, Pod::Xhtml, Text::GooglewikiFormat

Captcha

To keep robot out.

JOIN US

Top

Welcome to fork it in http://github.com/fayland/foorum/tree and pull requests back.

TODO

Top

http://code.google.com/p/foorum/issues/list

SEE ALSO

Top

Catalyst, DBIx::Class, Template

AUTHOR

Top

Fayland Lam, <fayland at gmail.com>

COPYRIGHT & LICENSE

Top


Foorum documentation Contained in the Foorum distribution.

package Foorum;

use strict;
use warnings;

use Catalyst::Runtime '5.70';
use parent qw/Catalyst/;
use Catalyst qw/
    ConfigLoader
    Static::Simple
    Authentication
    Cache
    Session::DynamicExpiry
    Session
    Session::Store::DBIC
    Session::State::Cookie
    I18N
    FormValidator::Simple
    Captcha
    +Foorum::Plugin::FoorumUtils
    /;

our $VERSION = '1.001000';

__PACKAGE__->config( { VERSION => $VERSION } );

__PACKAGE__->setup();

if ( __PACKAGE__->config->{function_on}->{page_cache} ) {
    __PACKAGE__->setup_plugins( ['PageCache'] );

    ## set $c->language before create a key in PageCache
    __PACKAGE__->config->{'Plugin::PageCache'}->{key_maker} = sub {
        my $c = shift;

        # something as the same as in Root.pm
        # while it is called before we call sub auto in Root.pm
        # and we may not call this if request doesn't call $c->cache_page
        my $lang;
        $lang = $c->req->cookie('lang')->value if ( $c->req->cookie('lang') );
        $lang ||= $c->user->lang if ( $c->user_exists );
        $lang ||= $c->config->{default_lang};
        $lang = $c->req->param('lang') if ( $c->req->param('lang') );
        $lang =~ s/\W+//isg;
        $c->languages( [$lang] );

        return '/' . $c->req->path;
    };
} else {
    {
        no strict 'refs';    ## no critic (ProhibitNoStrict)
        my $class = __PACKAGE__;
        *{"$class\::cache_page"}        = sub {1};
        *{"$class\::clear_cached_page"} = sub {1};
    }
}

1;
__END__