[development] Allow/Disallow path aliasing by settings

Ken Rickard agentrickard at gmail.com
Fri Jul 28 05:44:33 UTC 2006


After much discussion on the list, I actually wrote some code that takes a
pass at reducing the number of drupal_get_path requests,

http://drupal.org/node/75976

I talked some with Moshe on IRC (thanks!) and this patch is not intended to
do anything but let developers test whether this approach gives us any real
performance gains.

In this first pass, all I did was put in the structure that would allow an
administrator to remove certain paths from ever being looked up.  This
approach required a modification of url() and a new function to handle
lookup requests.  This function is drupal_alias_allowed($path).

In the current patch, all paths are still allowed, as the default array is
null.

To be honest, I tried to do more, but Forms API and admin settings gave me
some problems.  I'd like to do a textarea for entering 'allowed' paths one
per line, but couldn't make the code behave properly.

Without an admin, the way to test is to alter the variable_get within
drupal_alias_allowed(),  I would suggest making that value: array('node',
'user'), which would allow the creation of aliases only for paths the start
with 'node' or 'user.'

Feedback welcome.

- Ken Rickard
agentrickard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20060728/7cfa06f8/attachment.htm


More information about the development mailing list