[development] Alternative to drupal_bootstrap when we want to access Drupal data from other application?

Bruce Dou doubaokun at gmail.com
Mon Feb 14 02:32:23 UTC 2011


There is no way to skip that.

On Mon, Feb 14, 2011 at 2:41 AM, Dave Reid <dave at davereid.net> wrote:
> 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.
>
>



-- 
A decathlon Drupal developer & programmer
http://blog.eood.cn/


More information about the development mailing list