function _user_relationships_installation_query in User Relationships 5
Same name and namespace in other branches
- 5.2 user_relationships.install \_user_relationships_installation_query()
5 calls to _user_relationships_installation_query()
- user_relationships_install in ./
user_relationships.install - user_relationships_update_1 in ./
user_relationships.install - Update 1: Add timestamp to allow expiring unanswered requests
- user_relationships_update_2 in ./
user_relationships.install - Update 2: Add expiration of relationship requests
- user_relationships_update_3 in ./
user_relationships.install - Update 3: Add plural form of relationship type name
- user_relationships_update_4 in ./
user_relationships.install - Update 4: Add separate cache table for user relationship data
File
- ./
user_relationships.install, line 3
Code
function _user_relationships_installation_query($mysql = array(), $pgsql = array()) {
global $db_type;
$success = TRUE;
$queries = array();
if (strpos('mysql', $db_type) !== FALSE && $mysql) {
$queries = $mysql;
}
else {
if ($db_type == 'pgsql' && $pgsql) {
$queries = $pgsql;
}
else {
$success = FALSE;
drupal_set_message(t('Unsupported database.'));
}
}
foreach ($queries as $query) {
if (!db_query($query)) {
$success = FALSE;
break;
}
}
if ($success) {
drupal_set_message(t('User Relationships module installed successfully.'));
}
else {
drupal_set_message(t('The installation of the User Relationships module was unsuccessful.'), 'error');
}
}