FAQ
Hi folks,

I've implemented some custom config directives, works fine.

However, when my MapToStorage handler asks for the per_dir_config hash,
it seems to be getting the server config - all other handlers get the
per-dir no problem.

Any ideas?

cheers
John

Search Discussions

  • Fred Moyer at Oct 27, 2006 at 8:39 pm

    On Fri, 27 Oct 2006, John ORourke wrote:

    Hi folks,

    I've implemented some custom config directives, works fine.

    However, when my MapToStorage handler asks for the per_dir_config hash, it
    seems to be getting the server config - all other handlers get the per-dir no
    problem.
    My guess is that you cannot access MapToStorage because at this phase the
    request has not yet been associated with a particular filename or
    directory [1].

    [1]
    http://perl.apache.org/docs/2.0/user/handlers/http.html#PerlMapToStorageHandler
  • William A. Rowe, Jr. at Oct 27, 2006 at 8:49 pm

    Fred Moyer wrote:
    On Fri, 27 Oct 2006, John ORourke wrote:

    Hi folks,

    I've implemented some custom config directives, works fine.

    However, when my MapToStorage handler asks for the per_dir_config
    hash, it seems to be getting the server config - all other handlers
    get the per-dir no problem.
    My guess is that you cannot access MapToStorage because at this phase
    the request has not yet been associated with a particular filename or
    directory [1].

    [1]
    http://perl.apache.org/docs/2.0/user/handlers/http.html#PerlMapToStorageHandler
    Note that MapStorageToHandler does this association, so hook ordering plays
    a huge role. It's critical that if you plan to morph the entity you do so
    BEFORE the core directory_walk occurs, if you are inspecting it that should
    happen AFTER to core directory_walk.

    It's pretty simple; you shouldn't be modifying resources after they are vetted
    by directory_walk.

    That's why translations occur in the TranslateName hook. MapToStorage really
    should only be used to identify the URL to a resource, and if you are overriding
    the default, then a resource not in the filesystem.
  • Geoffrey Young at Oct 27, 2006 at 10:13 pm

    William A. Rowe, Jr. wrote:
    Fred Moyer wrote:
    On Fri, 27 Oct 2006, John ORourke wrote:

    Hi folks,

    I've implemented some custom config directives, works fine.

    However, when my MapToStorage handler asks for the per_dir_config
    hash, it seems to be getting the server config - all other handlers
    get the per-dir no problem.
    My guess is that you cannot access MapToStorage because at this phase
    the request has not yet been associated with a particular filename or
    directory [1].
    yes. in fact, you can't even place the PerlMapToStorageHandler in a
    <Location> block, so by definition you won't (yet) have a meaningful
    per-directory config.

    I wrote as much hours ago, but my response seems to have vanished into
    the aether. maybe it's been so long since I posted here the list daemon
    is trying to teach me a lesson :)

    Note that MapStorageToHandler does this association, so hook ordering plays
    a huge role. It's critical that if you plan to morph the entity you do so
    BEFORE the core directory_walk occurs, if you are inspecting it that should
    happen AFTER to core directory_walk.
    pretty much the only honest reason I can think of for writing a
    PerlMapToStorageHandler is for removing directory_walk on servers
    generating 100% dynamic content. of course, we often do very dishonest
    things over here in mod_perl land ;)

    --Geoff
  • John ORourke at Oct 28, 2006 at 3:19 pm
    Thanks for the answers folks... I must've been having a blonde moment,
    I'm sure I knew that somewhere.

    Skipping the directory walk is one of the reasons I'm using a
    MapToStorage handler - no need for all that disk access - but I'm also
    using it to map /content/some/path onto /content/<hostname>/some/path,
    so I wanted to enable/disable it in <Location>.

    I can tell my custom config to write config values into the server config.

    cheers
    John

    Geoffrey Young wrote:
    William A. Rowe, Jr. wrote:

    Fred Moyer wrote:


    On Fri, 27 Oct 2006, John ORourke wrote:



    Hi folks,

    I've implemented some custom config directives, works fine.

    However, when my MapToStorage handler asks for the per_dir_config
    hash, it seems to be getting the server config - all other handlers
    get the per-dir no problem.
    My guess is that you cannot access MapToStorage because at this phase
    the request has not yet been associated with a particular filename or
    directory [1].
    yes. in fact, you can't even place the PerlMapToStorageHandler in a
    <Location> block, so by definition you won't (yet) have a meaningful
    per-directory config.

    I wrote as much hours ago, but my response seems to have vanished into
    the aether. maybe it's been so long since I posted here the list daemon
    is trying to teach me a lesson :)


    Note that MapStorageToHandler does this association, so hook ordering plays
    a huge role. It's critical that if you plan to morph the entity you do so
    BEFORE the core directory_walk occurs, if you are inspecting it that should
    happen AFTER to core directory_walk.
    pretty much the only honest reason I can think of for writing a
    PerlMapToStorageHandler is for removing directory_walk on servers
    generating 100% dynamic content. of course, we often do very dishonest
    things over here in mod_perl land ;)

    --Geoff

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupmodperl @
categoriesmodperl, perl
postedOct 27, '06 at 7:16p
activeOct 28, '06 at 3:19p
posts5
users4
websiteperl.apache.org

People

Translate

site design / logo © 2021 Grokbase