重新安装Drupal?

因个人需要需要重新安装Drupal。如何操纵呢?Drupal是在_drupal_bootstrap_database()函数里面检查是否已经安装过的。检查的依据是有没有$GLOBALS['databases']设置,或者是有没有设置常量MAINTENANCE_MODE=install。

function _drupal_bootstrap_database() {
  // Redirect the user to the installation script if Drupal has not been
  // installed yet (i.e., if no $databases array has been defined in the
  // settings.php file) and we are not already installing.
  if (empty($GLOBALS['databases']) && !drupal_installation_attempted()) {
    include_once DRUPAL_ROOT . '/includes/install.inc';
    install_goto('install.php');
  }
  
  ... 
}

/**
 * Returns TRUE if a Drupal installation is currently being attempted.
 */
function drupal_installation_attempted() {
  return defined('MAINTENANCE_MODE') && MAINTENANCE_MODE == 'install';
}


$GLOBALS['databases']定义在sites/default/settings.php,Drupal安装时自动生成该文件。所以,要重新安装Drupal,简单地删除sites/default/settings.php就可以。

你可能感兴趣的:(drupal)