Remove unused code

This commit is contained in:
Bofh 2022-11-28 00:54:24 +01:00
parent 2be4a5b655
commit 36f62c7695
1 changed files with 2 additions and 7 deletions

View File

@ -4,20 +4,15 @@ class PgDatabase {
private $db = null;
public function __construct() {
$instance = isset($_GET['instance']) ? trim($_GET['instance']) : null;
if ($instance === null) return;
$url = trim($_SERVER['REQUEST_URI'], '/');
$url = substr($url, 7); // api/vX/
$ps = explode('/', $url);
if ($ps[0] !== 'database') return;
$software = $ps[1];
if (!preg_match('/^[a-zA-Z0-9\.\-\_]+$/', $instance))
apiresult(['error' => 'instance parameter is not correctly formatted'], 400);
if (!preg_match('/^[a-zA-Z0-9\.\-\_]+$/', $software))
apiresult(['error' => 'software parameter is not correctly formatted'], 400);
$config = instance_config($software);
if ($config === null) return;
$config = instance_config($software, $instance);
$this->db = pg_connect(
' host='.$config['psql_host'].
' port='.$config['psql_port'].