[development] Alternative to drupal_bootstrap when we want to access Drupal data from other application?
Dave Reid
dave at davereid.net
Sun Feb 13 18:41:33 UTC 2011
If you start skipping bootstrap phases then modules that inject data via
hook_node_load() or hook_entity_load() will not get run.
Dave Reid
dave at davereid.net
On Sat, Feb 12, 2011 at 9:06 PM, Ryan Chan <ryanchan404 at gmail.com> wrote:
> Hello,
>
> I want to use some Drupal7 functions such as node_load,
> taxonomy_term_load in my custom written PHP applications.
>
> I managed to use them by running a full drupal bootstrap, function is okay,
>
> i.e.
>
> drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
> $node = node_load(123);
>
> However, when profiling the code using Xdebug, I found
> drupal_bootstrap is just too heavy, i.e. used 80% of my application
> CPU time even I am doing simple query such as node_load.
>
> Of course, I can direct query the Drupal DB but I don't want to
> reinvent the wheel, but now seems it is too much overhead.
>
> Any suggestion when outside application want to access Drupal data,
> for the above basic query (read only)?
>
> Thanks.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20110213/550c7f5b/attachment-0001.html
More information about the development
mailing list