runeveryday Posted July 5, 2010 Share Posted July 5, 2010 function drupal_bootstrap($phase) { static $phases = array(DRUPAL_BOOTSTRAP_CONFIGURATION, DRUPAL_BOOTSTRAP_EARLY_PAGE_CACHE, DRUPAL_BOOTSTRAP_DATABASE, DRUPAL_BOOTSTRAP_ACCESS, DRUPAL_BOOTSTRAP_SESSION, DRUPAL_BOOTSTRAP_LATE_PAGE_CACHE, DRUPAL_BOOTSTRAP_LANGUAGE, DRUPAL_BOOTSTRAP_PATH, DRUPAL_BOOTSTRAP_FULL), $phase_index = 0; while ($phase >= $phase_index && isset($phases[$phase_index])) { $current_phase = $phases[$phase_index]; unset($phases[$phase_index++]); _drupal_bootstrap($current_phase); } } now if the code is drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);how to execute the above code? Quote Link to comment Share on other sites More sharing options...
trq Posted July 5, 2010 Share Posted July 5, 2010 You said it yourself. <?php drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); ?> Quote Link to comment Share on other sites More sharing options...
runeveryday Posted July 5, 2010 Author Share Posted July 5, 2010 You said it yourself. <?php drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); ?> the above function does't have a return,if i use drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); to call the above function , what value will be returned? another is static $phases = array(DRUPAL_BOOTSTRAP_CONFIGURATION, DRUPAL_BOOTSTRAP_EARLY_PAGE_CACHE, DRUPAL_BOOTSTRAP_DATABASE, DRUPAL_BOOTSTRAP_ACCESS, DRUPAL_BOOTSTRAP_SESSION, DRUPAL_BOOTSTRAP_LATE_PAGE_CACHE, DRUPAL_BOOTSTRAP_LANGUAGE, DRUPAL_BOOTSTRAP_PATH, DRUPAL_BOOTSTRAP_FULL), now the argument is DRUPAL_BOOTSTRAP_FULL, the line changes DRUPAL_BOOTSTRAP_FULL=array(DRUPAL_BOOTSTRAP_CONFIGURATION, DRUPAL_BOOTSTRAP_EARLY_PAGE_CACHE, DRUPAL_BOOTSTRAP_DATABASE, DRUPAL_BOOTSTRAP_ACCESS, DRUPAL_BOOTSTRAP_SESSION, DRUPAL_BOOTSTRAP_LATE_PAGE_CACHE, DRUPAL_BOOTSTRAP_LANGUAGE, DRUPAL_BOOTSTRAP_PATH, DRUPAL_BOOTSTRAP_FULL), this give the array to the variable DRUPAL_BOOTSTRAP_FULL. am i right? i feel it useless.thank you. Quote Link to comment Share on other sites More sharing options...
trq Posted July 5, 2010 Share Posted July 5, 2010 the above function does't have a return,if i use drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); to call the above function , what value will be returned? None. another is static $phases = array(DRUPAL_BOOTSTRAP_CONFIGURATION, DRUPAL_BOOTSTRAP_EARLY_PAGE_CACHE, DRUPAL_BOOTSTRAP_DATABASE, DRUPAL_BOOTSTRAP_ACCESS, DRUPAL_BOOTSTRAP_SESSION, DRUPAL_BOOTSTRAP_LATE_PAGE_CACHE, DRUPAL_BOOTSTRAP_LANGUAGE, DRUPAL_BOOTSTRAP_PATH, DRUPAL_BOOTSTRAP_FULL), now the argument is DRUPAL_BOOTSTRAP_FULL, the line changes DRUPAL_BOOTSTRAP_FULL=array(DRUPAL_BOOTSTRAP_CONFIGURATION, DRUPAL_BOOTSTRAP_EARLY_PAGE_CACHE, DRUPAL_BOOTSTRAP_DATABASE, DRUPAL_BOOTSTRAP_ACCESS, DRUPAL_BOOTSTRAP_SESSION, DRUPAL_BOOTSTRAP_LATE_PAGE_CACHE, DRUPAL_BOOTSTRAP_LANGUAGE, DRUPAL_BOOTSTRAP_PATH, DRUPAL_BOOTSTRAP_FULL), this give the array to the variable DRUPAL_BOOTSTRAP_FULL. am i right? i feel it useless.thank you. No, you are not right at all. I'm really not sure where your even getting these ideas from. The code is terrible though. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.