[pmwiki-users] CamelCaseToLowerCase in Router.php with Apache mod-rewrite module

Benoit St-Pierre benbonben at gmail.com
Tue May 11 12:25:04 CDT 2010


Thanks!

I'll drop router.php, but why, for curiosity's sake?

***

But now, I have another question.  In the documentation, it says:

> (Beware, if you do NOT uppercase the first letter of your pagenames, the wiki will stop recognizing them as files, and you will need to alter the variables:

    $GroupPattern = '[\\w]*(?:-\\w+)*';
    $NamePattern = '[\\w]*(?:-\\w+)*';

Later on, it says to include:

> $MakePageNamePatterns = array(
    "/'/" => '',						# strip single-quotes
    "/[^[:alnum:]_-\\s]+/" => '',				# convert non-alnums to spaces
    "/([\\w]+)/e" => "strtolower('$1')",			# make all lowercase
    "/\\s+/" => '_'						# convert spaces to underscores
);

$GroupPattern = '[\\w]*(?:-\\w+)*';
$NamePattern = '[\\w]*(?:-\\w+)*';

Aren't these two advices contradictory?

Besides, it seems that there is a side-effect, underlined by Kathryn Andersen :

> The downside of this is that all the pages in PmWiki and Site will no longer be found. I'm not sure how to get around this.

I am not sure what she means, but it seems to me that what one needs
to do, then, is simply to rename every file.  Am I right?

***

After a bit of testing, it seems I am not right.  Since I haven't done
so many pages, and that those have to be renamed anyway (I am
revamping my groups), it's not that much of a problem.  But my overall
impression is that all the pages will have to be redone.

In any case, it would be interesting to have some reassurance as to
the Main.HomePage and Site pages.

The page http://www.pmwiki.org/wiki/Cookbook/AlternateNamingScheme is
very important, IMHO, as lowercase-with-hyphens URI are becoming very
popular.  The explanation should be clarified.

Thank you for all the great work and the great tool !

Best regards,

Ben



More information about the pmwiki-users mailing list