You are here

function views_data_export_plugin_display_export::_get_database_driver in Views data export 6.3

Same name and namespace in other branches
  1. 6.2 plugins/views_data_export_plugin_display_export.inc \views_data_export_plugin_display_export::_get_database_driver()
  2. 7.4 plugins/views_data_export_plugin_display_export.inc \views_data_export_plugin_display_export::_get_database_driver()
  3. 7.3 plugins/views_data_export_plugin_display_export.inc \views_data_export_plugin_display_export::_get_database_driver()
2 calls to views_data_export_plugin_display_export::_get_database_driver()
views_data_export_plugin_display_export::is_compatible in plugins/views_data_export_plugin_display_export.inc
Checks the driver of the database underlying this query and returns FALSE if it is imcompatible with the approach taken in this display. Basically mysql & mysqli will be fine, pg will not
views_data_export_plugin_display_export::options_form in plugins/views_data_export_plugin_display_export.inc
Provide the default form for setting options.

File

plugins/views_data_export_plugin_display_export.inc, line 729
Contains the bulk export display plugin.

Class

views_data_export_plugin_display_export
The plugin that batches its rendering.

Code

function _get_database_driver() {

  // Lifted out of the middle of db_set_active()
  $name = !empty($this->view->base_database) ? $this->view->base_database : 'default';
  global $db_url, $db_type, $active_db;
  if (is_array($db_url)) {
    $connect_url = array_key_exists($name, $db_url) ? $db_url[$name] : $db_url['default'];
  }
  else {
    $connect_url = $db_url;
  }
  $db_type = substr($connect_url, 0, strpos($connect_url, '://'));
  return $db_type;
}