<div dir="ltr">On Wed, Apr 29, 2015 at 9:55 PM, Bernd Schatz <span dir="ltr"><<a href="mailto:bernd.schatz@gmx.net" target="_blank">bernd.schatz@gmx.net</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
Am 25.04.2015 um 18:50 schrieb Wolfgang Faust:> PPRA() checks if the replacement is a callable, and uses<br>
<span class="">> preg_replace_callback if necessary. Instead of using /e in the pattern,<br>
> make the replacement an anonymous function, like so:<br>
> $MakePageNamePatterns = array(<br>
>      "/([\\w])+/" => function($match) {<br>
>         return strtolower($match[1]); # all lowercase<br>
>     },<br>
>     "/\\s+/" => ''                          # remove spaces<br>
> );<br>
<br>
<br>
</span>Great, that was it:<br>
<br>
$MakePageNamePatterns = array(<br>
     "/(^\w)(\w+)/" => function($match)<br>
     {<br>
           return strtoupper($match[1]).strtolower($match[2]); # all lowercase, except first character<br>
<span class="">     },<br>
    "/\\s+/" => ''                          # remove spaces<br>
);<br>
<br></span></blockquote><div>Hooray! <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">
<br>
</span>To fix already existing pages in directory wiki.d ==><br>
for i in $(ls -1); do mv $i  $(echo $i | sed -e 's/Main\.\(\w\)\(.*\)/Main.\U\1\L\2/g'); done;<br>
<br>
<br>
To fix special pages (hard coded anywhere ???) ==><br>
ln -s Main.Sidebar Main.SideBar<br>
<br></blockquote><div>Rather than symlinking (which will in effect create duplicate pages) why not set up a redirect? <a href="http://www.pmwiki.org/wiki/PmWiki/PageDirectives#redirect">http://www.pmwiki.org/wiki/PmWiki/PageDirectives#redirect</a><br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Now there is still a small issue with the PmWiki.* and Site.* pages,<br>
but i think you could fix it with a small script that creates a link for every of this pages.<br>
<br>
<br>
thx and greets<br>
<span class=""><font color="#888888"><br>
  Bernd<br>
<br>
<br>
<br>
<br>
<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr">The views expressed above are exclusively mine, if anyone's.<br></div></div>
</div></div>