On Tue, Mar 3, 2009 at 2:54 PM, Louis-David Mitterrand
<vindex+lists-mason-us...@apartia.org> wrote:
> On Tue, Mar 03, 2009 at 02:35:42PM +0000, Jérôme Etévé wrote:
>> Hi, you can use PerlSetVar directive in your apache config and then
>> access variable values with dir_config.
>>
>> Ex:
>>
>> in apache:
>> PerlSetVar MyAlmightyConstant "heihfi23857278957289"
>>
>> In your mason code:
>> $r->dir_config('MyAlmightyConstant');
>>
>> This is a mod_perl feature.
>
> Interesting feature.
>
> So I could set stuff in the autohandler's <%once> section:
>
> <%once>
> $r->dir_config(adsense_code1=>"bar");
> $r->dir_config(other_constant=>"foo");
> </%once>
>
> and simply retrieve them anywhere in the mason code.
>
> Thanks,

Hi,
  Yes most probably,

  See 
http://search.cpan.org/~gozer/mod_perl-2.0.4/docs/api/Apache2/RequestUtil.pod#dir_config

  I tend to use them at the place they are needed. For instance in
your adsense block:
  adsense_pubid:<% $r->dir_config('MySiteAdSensePubId') %> ;

Jerome.


> http://www.critikart.net
>
> ------------------------------------------------------------------------------
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a $600 discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> Mason-users mailing list
> Mason-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mason-users
>



-- 
Jerome Eteve.

Chat with me live at http://www.eteve.net

jer...@eteve.net

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to