Use the Drupal Bootstrap
Rob Loach - February 6, 2008 - 06:55
| Project: | Services |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | marcingy |
| Status: | won't fix |
Jump to:
Description
Moshe Weitzman posted a great comment on my website stating that we should take advantage of the Drupal bootstrap system by putting a services.php file in the Drupal root directory that would only load parts of Drupal via drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE">).

#1
I've thought about this ...
How would we determine which type of server services.php would serve? With the current method, we're doing this with the menu system. I suppose we could do a normal unclean url, but I've had problems with AMFPHP and unclean urls because of AMFPHP wanting to add a sessid query parameter. Hmmm ... We _are_ going to need a much lighter bootstrap for this to work on heavier sites though and this would be the way to do it. Perhaps a special url rewrite could be used to map /services/server to the lightweight services.php?q=services/server instead of index.php?q=services/server, if the particular server doesn't like unclean urls. Or, maybe we bypass the menu system altogether and detect which type of server through other means? That would certainly be lightweight.
#2
To be reviewed as part of drupal 7.
#3
With the registry patch does this become less of an issue? http://drupal.org/node/221964.
The patch gives on demand loading so in theory we shouldn't need to trim the bootstrap.
#4
Registry patch will give a big boost, so we don't need to think about performance issues at this point.