re-factor php/drupal init.