You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs@httpd.apache.org by Marion & Christophe JAILLET <ch...@wanadoo.fr> on 2016/04/02 08:26:50 UTC

Re: Frédéric Trégon commented on http://httpd.apache.org/docs/2.4/mod/mod_macro.html

Hi,

mod_macro states that:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you want to use a value within another string, it is useful to 
surround the parameter in braces, to avoid confusion:

<Macro DocRoot ${docroot}>
     DocumentRoot "/var/www/${docroot}/htdocs"
</Macro>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

As written in the comment below, it works but it triggers a warning.

When the directive is parsed, we first try to resolve env variable. This 
is why we get the warning.

In order to fix it we could just update the doc.
For example, using [] instead of {} works fine.
Or we could stipulate that if [} are used, then the in % prefix should 
be used instead of $.


Any opinion?

CJ



Le 31/03/2016 10:54, no-reply@comments.apache.org a écrit :
> Hello,
>      Frédéric Trégon has commented on 
> http://httpd.apache.org/docs/2.4/mod/mod_macro.html.
>      You can find the comment here:
> http://httpd.apache.org/docs/2.4/mod/mod_macro.html#comment_5250
>
>      Below is the reply that was posted:
>      ~~~~
>      When using the tip about surrounding the parameter in braces:
> ---
> <Macro DocRoot ${docroot}>
> ---
>
> You get a warning:
> ---
> AH00111: Config variable ${docroot} is not defined
> ---
>
> The warning disappears if you remove the braces.
>
> So is it really the recommended way for defining parameters?
>      ~~~~
>


Re: Frédéric Trégon commented on http://httpd.apache.org/docs/2.4/mod/mod_macro.html

Posted by Rich Bowen <rb...@rcbowen.com>.
Yeah, we should pick one and be consistent throughout the doc. It's all
very well that there's more than one way to do it, but it makes for
confusing docs.
On Apr 2, 2016 8:15 AM, "Luca Toscano" <to...@gmail.com> wrote:

> Hi!
>
> 2016-04-02 8:26 GMT+02:00 Marion & Christophe JAILLET <
> christophe.jaillet@wanadoo.fr>:
>
>> Hi,
>>
>> mod_macro states that:
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> If you want to use a value within another string, it is useful to
>> surround the parameter in braces, to avoid confusion:
>>
>> <Macro DocRoot ${docroot}>
>>     DocumentRoot "*/var/www/*${docroot}/htdocs"
>> </Macro>
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> As written in the comment below, it works but it triggers a warning.
>>
>> When the directive is parsed, we first try to resolve env variable. This
>> is why we get the warning.
>>
>> In order to fix it we could just update the doc.
>> For example, using [] instead of {} works fine.
>> Or we could stipulate that if [} are used, then the in % prefix should be
>> used instead of $.
>>
>>
>> Any opinion?
>>
>
> I would prefer to use %{} rather than $[] but it is only a matter of
> taste, no strong argument in favor of one or the other. I took a look to
> https://httpd.apache.org/docs/current/mod/mod_macro.html and it seems a
> bit confusing that in "Tips" we suggest to use ${} in order to embed
> something into a string but we don't follow this convention throughout the
> doc page. Am I missing something?
>
> Thanks!
>
> Luca
>

Re: Frédéric Trégon commented on http://httpd.apache.org/docs/2.4/mod/mod_macro.html

Posted by Luca Toscano <to...@gmail.com>.
Hi!

2016-04-02 8:26 GMT+02:00 Marion & Christophe JAILLET <
christophe.jaillet@wanadoo.fr>:

> Hi,
>
> mod_macro states that:
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> If you want to use a value within another string, it is useful to surround
> the parameter in braces, to avoid confusion:
>
> <Macro DocRoot ${docroot}>
>     DocumentRoot "*/var/www/*${docroot}/htdocs"
> </Macro>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> As written in the comment below, it works but it triggers a warning.
>
> When the directive is parsed, we first try to resolve env variable. This
> is why we get the warning.
>
> In order to fix it we could just update the doc.
> For example, using [] instead of {} works fine.
> Or we could stipulate that if [} are used, then the in % prefix should be
> used instead of $.
>
>
> Any opinion?
>

I would prefer to use %{} rather than $[] but it is only a matter of taste,
no strong argument in favor of one or the other. I took a look to
https://httpd.apache.org/docs/current/mod/mod_macro.html and it seems a bit
confusing that in "Tips" we suggest to use ${} in order to embed something
into a string but we don't follow this convention throughout the doc page.
Am I missing something?

Thanks!

Luca

Re: Frédéric Trégon commented on http://httpd.apache.org/docs/2.4/mod/mod_macro.html

Posted by Christophe JAILLET <ch...@wanadoo.fr>.
This is also reported as PR 58304
(https://bz.apache.org/bugzilla/show_bug.cgi?id=58304)

CJ

Le 02/04/2016 08:26, Marion & Christophe JAILLET a écrit :
> Hi,
>
> mod_macro states that:
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> If you want to use a value within another string, it is useful to 
> surround the parameter in braces, to avoid confusion:
>
> <Macro DocRoot ${docroot}>
>     DocumentRoot "/var/www/${docroot}/htdocs"
> </Macro>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> As written in the comment below, it works but it triggers a warning.
>
> When the directive is parsed, we first try to resolve env variable. 
> This is why we get the warning.
>
> In order to fix it we could just update the doc.
> For example, using [] instead of {} works fine.
> Or we could stipulate that if [} are used, then the in % prefix should 
> be used instead of $.
>
>
> Any opinion?
>
> CJ
>
>
>
> Le 31/03/2016 10:54, no-reply@comments.apache.org a écrit :
>> Hello,
>>      Frédéric Trégon has commented on 
>> http://httpd.apache.org/docs/2.4/mod/mod_macro.html.
>>      You can find the comment here:
>> http://httpd.apache.org/docs/2.4/mod/mod_macro.html#comment_5250
>>
>>      Below is the reply that was posted:
>>      ~~~~
>>      When using the tip about surrounding the parameter in braces:
>> ---
>> <Macro DocRoot ${docroot}>
>> ---
>>
>> You get a warning:
>> ---
>> AH00111: Config variable ${docroot} is not defined
>> ---
>>
>> The warning disappears if you remove the braces.
>>
>> So is it really the recommended way for defining parameters?
>>      ~~~~
>>
>