Started integrating external systems
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
// External data source
|
||||
|
||||
class ExtSys {
|
||||
|
||||
public $name;
|
||||
protected $conn;
|
||||
|
||||
function __construct($xtype, $dbconfig) {
|
||||
if (! $config['enabled']) {
|
||||
throw new Exception('Not allowed to create connection to ' . $xtype);
|
||||
}
|
||||
switch ($config['xtype']) {
|
||||
'cdb':
|
||||
$this->name = 'Computerdatenbank';
|
||||
cdb_init($dbconfig);
|
||||
break;
|
||||
'logi':
|
||||
$this->name = 'Loginventory';
|
||||
logi_init($dbconfig);
|
||||
break;
|
||||
'topdesk':
|
||||
$this->name = 'Topdesk';
|
||||
tdesk_init($dbconfig);
|
||||
break;
|
||||
'zabbix':
|
||||
$this->name = 'Zabbix';
|
||||
zbx_init($dbconfig);
|
||||
break;
|
||||
default:
|
||||
throw new Exception('Invalid xtype');
|
||||
}
|
||||
}
|
||||
|
||||
private function mariadb_connect() {
|
||||
return false;
|
||||
}
|
||||
|
||||
private function mssql_connect() {
|
||||
return false;
|
||||
}
|
||||
|
||||
private function cdb_init() {
|
||||
mariadb_connect();
|
||||
}
|
||||
|
||||
private function logi_init() {
|
||||
mssql_connect();
|
||||
}
|
||||
|
||||
private function tdesk_init() {
|
||||
mssql_connect();
|
||||
}
|
||||
|
||||
private function zbx_init() {
|
||||
mariadb_connect();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user