1

HTML::MasonプロジェクトでApache::Session :: Memcachedを使用しようとしています。ここでは、 MasonX :: Request::WithApacheSessionを使用してセッションを処理しています。残念ながら、MySQLモジュールの代わりにMemcachedモジュールをプラグインすると、Apacheは起動しません。私のカスタムハンドラーは次のようになります(あちこちでいくつかの切り取り):

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,                                          
    );   

私が遭遇している問題は、session_*Memcachedに固有のパラメーターが、ドキュメントに記載されているようにApache :: Session::Memcachedに渡されていないことです。これにより、次のエラーが発生します。

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

今、私は3つの大文字の引数すべてを調べて小文字に交換しましたが、役に立ちませんでした。また、 Apache :: Session :: Memcachedのドキュメントには、大文字で記載されています。

助けてくれてありがとう。

4

1 に答える 1

4

http://search.cpan.org/perldoc/Apache::Session::Wrapper#REGISTERING_CLASSESの指示に従って、Apache :: Session::MemcachedをApache::Session::Wrapperに登録する必要があるようです。 (コード提供:Jack M.):

Apache::Session::Wrapper::->RegisterClass(
    'name' => 'Apache::Session::Memcached',
    'required' => [ [ 'Servers' ], ],
    'optional' => [ 'NoRehash', 'Readonly', 'Debug', 'CompressThreshold', ],
);
于 2009-07-01T01:56:19.067 に答える