|
Tutorial1
NAMEFoorum::Manual::Tutorial1 - Tutorial 1: Catalyst Plugins used in Foorum Config::YAMLCatalyst::Plugin::Config::YAML::XS Why we are using Config::YAML::XS instead ConfigLoader is under a simple RULES, Fast is better. Static::SimpleCatalyst::Plugin::Static::Simple I think I need let Static::Simple be configurable later. because it's better let Apache handles static contents. AuthenticationCatalyst::Plugin::Authentication Authentication is a important part in Foorum. viacheslav.t suggests Another thing that i am concerned about is a way how to plug-in your forum to an existing Cat application. For example i have my own user infrastructure and registration, banning, blocking system (some things are borrowed from your code ;-)... I'm strongly agree with him. so we will rewrite this part later. but for now. in foorum.yml authentication:
default_realm: 'members'
password_hash_type: "SHA-1"
realms:
members:
credential:
class: 'Password'
password_field: 'password'
password_type: "hashed"
password_hash_type: "SHA-1"
store:
class: 'FromSub::Hash'
model_class: "UserAuth"here we are using Credential::Password and a Store::FromSub::Hash. I must admit that FromSub::Hash is not good enough. but it doesn't hit database every request for $c->user. Store::DBIC is nice yet our Model/User.pm sub get is returning a cached user hash. so we use FromSub::Hash. Cachebefore we use Catalyst::Plugin::Cache::Memcached, but that's not so flexiable. so we turn to use Catalyst::Plugin::Cache. the configuration in foorum.yml is: cache:
backends:
default:
class: 'Cache::FileCache'
namespace: 'Foorum'
default_expires_in: 600meanwhile, we can use Memcached: cache:
backends:
default:
class: Cache::Memcached
compress_threshold: 10_000
debug: 0
servers:
- 127.0.0.1:11211Session::DynamicExpiryCatalyst::Plugin::Session::DynamicExpiry for the "Remember Me?". Sessionthat's pretty normal here. we use DBIC and Cookie. no URI since that's bad. I18Ncheck Foorum/I18N/cn.po and tw.po then u can write one for your own. that's easy! FormValidator::SimpleCatalyst::Plugin::FormValidator::Simple we are going to HTML::FormFu. Captchacaptcha:
session_name: captcha_string
new:
width: 80
height: 30
lines: 1
gd_font: giant
create:
- normal
- rect
particle:
- 100
out:
force: jpegPageCacheit's configurable. u can disable by set function_on: maintain: 0 register: 1 create_forum: 1 scraper: 0 page_cache: 0 when page_cache: 1, it will be enabled. SEE ALSO |
Sign in to add a comment