You are here

public function FrxRepoMan::load_provider in Forena Reports 7.3

Same name and namespace in other branches
  1. 7.4 FrxRepoMan.inc \FrxRepoMan::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 FrxRepoMan::load_provider()
FrxRepoMan::load_repository in ./FrxRepoMan.inc

File

./FrxRepoMan.inc, line 115
FrxRepoMan.inc Enter description here ... @author davidmetzler

Class

FrxRepoMan
@file FrxRepoMan.inc Enter description here ... @author davidmetzler

Code

public function load_provider($conf, $repo_path, $repos_name) {
  @($name = isset($conf['data provider']) ? $conf['data provider'] : $conf['data_engine']);
  Frx::plugins('FrxDataSource');

  // Instantiate the path
  if (class_exists($name)) {
    $o = new $name($conf, $repo_path, $repos_name);
    return $o;
  }
  else {
    Frx::error('Data provider not found for ' . $conf['title']);
  }
}