[drupal-devel] url aliases

Moshe Weitzman weitzman at tejasa.com
Tue May 3 13:37:43 UTC 2005


> It is probably not the sql query SELECT * FROM {url_alias} that is the
> problem, but the processing in php afterwards (looping over the
> results). 

this is such a common operation. It would be nice if there were some 
optimized function to turn a mysql result object into a php array.

This happens in drupal_get_path_map(). Is there any reason why
> we couldn't only select the alias we need? Currently, we need all the
> aliases because we want to make sure they can be used when creating
> links on the generated page.
> 
> Wouldn't it be possible to
> 
> 1) during processing collect all the urls that are going to be on a page
> and
> 2) only retreive the needed aliases based on this info?
> 
> Cheers,


this would be possible if we left placeholders in the HTML and then 
replaced with aliased urls right before we print the page. In order to 
do so, we need some significant changes though:

- modules always return output instead of printing theme('page')
- add a 'replace url placeholders' step before calling the theme('page')
- somehow replace placeholders for links emitted within the 
theme('page') like html_head, blocks, etc.



More information about the drupal-devel mailing list