Closed (won't fix)
Project:
Services
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
6 Feb 2008 at 06:55 UTC
Updated:
29 Oct 2017 at 19:19 UTC
Jump to comment: Most recent
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">).
Comments
Comment #1
snelson commentedI'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.
Comment #2
marcingy commentedTo be reviewed as part of drupal 7.
Comment #3
marcingy commentedWith 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.
Comment #4
magico commentedRegistry patch will give a big boost, so we don't need to think about performance issues at this point.
Comment #5
FreddieK commentedFrom the linked thread on the registry patch, by Crell:
"[...] The registry has already been rolled back and is no longer part of Drupal 7, save for a cache of class/interface definitions. There is no more registry for functions."
Does this mean that perhaps this issue should be opened again?
Comment #6
bibo commentedSome of us do, still, actually all the time. I guess you we're just speaking from the services-module pov? I myself am looking for the best way of using partial bootstrap on D7 (just "DRUPAL_BOOTSTRAP_DATABASE"), but it needs to be pluggable / extendable and reliable.
Something like js, but that D6 only. I could do it myself, but I'd I was hoping this case could give a hint to avoid common pitfalls.
Comment #7
ethanw commentedThe question of Services bootstrapping recently came up on a comment thread regarding the Backbone module's use of Services. I would also vote for re-opening this request, I think it's important for developers of REST-based webapps and UIs on Drupal.
That said, I wonder if a patch to htaccess wouldn't be a better way to go. I'd suggest using a rewrite rule to redirect all requests for a given endpoint URL to a server.php file in the Services module directory. If the rewrite rule isn't present, the current full-bootstrap logic could still be used via the menu router. If the redirect points to server.php instead of index.php, Services could leverage an array of optimizations.
Comment #8
marcingy commentedI have the feeling as there is a hard dependency on ctools that boot strap full is going to be required, I might be wrong. This issue was originally created in much simpler times. If we could offer a lower level bootstrap option that would be great...it might work for certain get requests.
Comment #9
JoshRickert commentedI know I'm digging up an old thread, but this issue is still relevant in my opinion. Came across this issue in my searches for improving the performance of services. The js module mentioned above has since been ported to 7, so that seems like a good candidate for integration.
Comment #10
Anonymous (not verified) commentedHave a look at https://github.com/jacobbednarz/lightweight-drupal-rest-services .
Comment #11
pribeh commentedUsing the JS Callback Handler seems like a great candidate.