2009-06-30 31 views
1

我想在HTML::Mason项目中使用Apache::Session::Memcached项目,我使用MasonX::Request::WithApacheSession来处理我的会话。不幸的是,当我插入Memcached模块而不是MySQL时,Apache不会启动。我的自定义处理程序看起来像这样(在这里的几个剪,有):使用Apache :: Session :: Memcached与MasonX ::请求:: WithApacheSession

my $ah = HTML::Mason::ApacheHandler->new (
    comp_root     => $ENV{HTDOCS}, 
    data_dir     => $data_dir, 
    request_class    => 'MasonX::Request::WithApacheSession', 
    session_use_cookie   => 0, 
    args_method     => "mod_perl", 
    session_args_param   => 'session_id', 
    session_class    => 'Apache::Session::Memcached', 
    session_Servers    => '127.0.0.1:20000', 
    session_Readonly   => 0, 
    session_Debug    => 1, 
    session_cookie_domain  => $CONF->{global}->{site_name}, 
    session_cookie_expires  => "session", 
    session_allow_invalid_id => 0,           
    ); 

我遇到的问题是,具体到Memcached中的session_* PARAMATERS不被通过对Apache::Session::Memcached方式通the docs say it should。这导致了这个错误:

The following parameter was passed in the call to HTML::Mason::ApacheHandler->new() 
but was not listed in the validation options: session_Servers 

现在,我已经经历了和所有交换的3点大写的参数,以降低的情况下,都无济于事。并且the docsApache::Session::Memcached将它们列为大写。

非常感谢您的帮助。

回答

4

看起来你需要注册的Apache ::会议::与Apache ::会议::包装了Memcached,继http://search.cpan.org/perldoc/Apache::Session::Wrapper#REGISTERING_CLASSES像这样(代码礼貌杰克M.)的说明:

Apache::Session::Wrapper::->RegisterClass(
    'name' => 'Apache::Session::Memcached', 
    'required' => [ [ 'Servers' ], ], 
    'optional' => [ 'NoRehash', 'Readonly', 'Debug', 'CompressThreshold', ], 
); 
+3

你,先生/女士是男人/女人!我一直在为这件事烦恼。我没有编辑你的帖子的代表,但你应该把它放在那里: Apache :: Session :: Wrapper-> RegisterClass( name =>'Apache :: Session :: Memcached', required => [['Servers'],], optional => ['NoRehash','Readonly','Debug','CompressThreshold'], ); – 2009-07-01 14:39:56