[development] strange inconsistency: 'custom_url_rewrite'

Gabor Hojtsy gabor at hojtsy.hu
Mon Dec 26 22:35:03 UTC 2005


> while writing a tiny module to make these fancy 'web2.0' *cough* urls in the 
> form of tag1+tag2+tag3 I ran across a rather strange issue.
> 
>  custom_url_rewrite  works as expected, but is rather OO unfriendly. I mean, 
> if I define that, Drupal wil FAil to even load if someone adds another module 
> with this, or if a person has this function define in her settings.php.
> 
> Why is this not hook_url_rewrite? Am I missing something? Is it a performance 
> thing? 

It is a performance thing mostly. It was discussed that allowing more
than one url rewrite function would lead to great unexpected pains
(execution order, speed), and the single named function method was
choosen. You can always do conditional function definitions in PHP.

if (!function_exists('somefunction')) {
  function somefunction () {
  }
}

Goba


More information about the development mailing list