[pmwiki-users] What is the correct use of slashes

K.A.Bouton k.a.bouton at reading.ac.uk
Fri Jul 15 08:54:37 CDT 2005


> In PHP, the single quotes mean not to do any substitutions in 
> the string (in PmWiki this ends up meaning "perform the 
> substitution later"), while the double quotes mean to 
> immediately substitution the values of $-variables into the 
> string, unless the $ is preceded by a backslash.  '$FullName' 
> and '$Group' are special substitutions handled by PmWiki 
> later when the actual pagename is known, thus we always have 
> to suppress their substitution by either using single quotes 
> for the string or preceding them with a backslash.
> 
> Perhaps someone else on the list can come up with a clearer 
> explanation -- my head seems a bit fogged at the moment.  :-|

just to make sure.
I understand about the backslashes and special PmWiki variable $FullName

  new PageStore("$FarmD/shared.d/\$FullName")
                ^                ^         ^
uses double quotes with backslash $Special_PmWiki_variable($FullName)

is the same as

  new PageStore('$FarmD/shared.d/$FullName')
                ^                ^         ^
uses single quote nobackslash $Special_PmWiki_variable($FullName)

Is there any reason to use one and not the other?


But I don't understand how ("$FarmD  and ('$FarmD are, or are not, the same

$WikiLibDirs = array(&$WikiDir,
    1)    new PageStore("$FarmD/wiki.d/\$FullName"),
    2)    new PageStore("$FarmD/shared.d/\$FullName"),
    3)    new PageStore('$FarmD/wikilib.d/$FullName'));

Shouldn't line 3) be 
    3)   new PageStore("$FarmD/wikilib.d/\$FullName"));

I know... Confusing as heck
:)

Katherine





More information about the pmwiki-users mailing list