Remove unused code
This commit is contained in:
parent
2be4a5b655
commit
36f62c7695
|
@ -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'].
|
||||
|
|
Loading…
Reference in New Issue