You are here

function domain_prefix_get_prefix in Domain Access 5

Same name and namespace in other branches
  1. 6.2 domain_prefix/domain_prefix.module \domain_prefix_get_prefix()

Check for existing table prefixing.

2 calls to domain_prefix_get_prefix()
domain_prefix_get_tables in domain_prefix/domain_prefix.module
Get the tables with the active prefix
domain_prefix_update_sequences in domain_prefix/domain_prefix.module
Correct the {sequences} table if doing an update.

File

domain_prefix/domain_prefix.module, line 72
Interface for selective table prefixing for use with Domain Access. For this module to work correctly, you will need to follow the INSTALL.txt instructions for editing your settings.php file.

Code

function domain_prefix_get_prefix() {
  global $db_prefix;

  // Check for existing table prefixing.
  $prefix = NULL;
  if (!empty($db_prefix)) {
    if (is_array($db_prefix)) {
      $prefix = $db_prefix['default'];
    }
    else {
      $prefix = $db_prefix;
    }
  }
  return $prefix;
}