public static function getInstance($source_name) { if (empty(self::$source_map[$source_name])) { require_once 'include/connectors/sources/SourceFactory.php'; require_once 'include/connectors/component.php'; $source = SourceFactory::getSource($source_name); $component = new component(); $component->setSource($source); $component->init(); self::$source_map[$source_name] = $component; } return self::$source_map[$source_name]; }
public static function getInstance($source_name) { if (empty(self::$source_map[$source_name])) { require_once 'include/connectors/sources/SourceFactory.php'; require_once 'include/connectors/component.php'; $source = SourceFactory::getSource($source_name); if (empty($source)) { $GLOBALS['log']->fatal("Failed to load source {$source_name}"); return false; } $component = new component(); $component->setSource($source); $component->init(); self::$source_map[$source_name] = $component; } return self::$source_map[$source_name]; }