PHP 确保Drupal模块中的挂钩在其他模块之前运行。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PHP 确保Drupal模块中的挂钩在其他模块之前运行。相关的知识,希望对你有一定的参考价值。

function your_modulename_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      $weight = db_result(db_query('SELECT MIN(weight) AS weight FROM {system} WHERE status = 1')) - 1;
      db_query("UPDATE {system} SET weight = %d WHERE name  = '%s'", $weight, 'your_modulename');
    break;
    default:
      drupal_set_message(t('Your database type is not supported'));
  }
}

以上是关于PHP 确保Drupal模块中的挂钩在其他模块之前运行。的主要内容,如果未能解决你的问题,请参考以下文章