$hook, '!db' => $db)); drupal_set_message($msg, 'error'); } } /** * Execute a database query. Based on db_query() and update_sql(). */ function _roundcube_install_db_query($query) { // Get the arguments. $args = func_get_args(); array_shift($args); if (isset($args[0]) and is_array($args[0])) { $args = $args[0]; } // Build the query. $query = db_prefix_tables($query); _db_query_callback($args, true); $query = preg_replace_callback(DB_QUERY_REGEXP, '_db_query_callback', $query); // Do the database query, and return the status. $result = _db_query($query); return array('success' => $result !== false, 'query' => check_plain($query)); } /** * Returns the name of this module. */ function _roundcube_install_module_name() { return substr(__FUNCTION__, 1, strpos(__FUNCTION__, '_', 1) - 1); }