You are here

function __forena_load_provider in Forena Reports 6

Same name and namespace in other branches
  1. 7 forena.common.inc \__forena_load_provider()

Load the data provider class based on the class name.

Parameters

string $name:

Return value

object The data provider object

1 call to __forena_load_provider()
__forena_load_repository in ./forena.common.inc

File

./forena.common.inc, line 143
Common functions used throughout the project but loaded in this file to keep the module file lean.

Code

function __forena_load_provider($conf, $repo_path) {
  $name = $conf['data provider'];
  if (!$name) {
    $name = $conf['data_engine'];
  }
  forena_define_plugins();

  // Instantiate the path

  //drupal_set_message("conf: <pre>". print_r($conf, 1) ."</pre>  repo_path: <pre>". print_r($repo_path,1) ."</pre>");
  if (class_exists($name)) {
    $o = new $name($conf, $repo_path);
    return $o;
  }
}