aboutsummaryrefslogtreecommitdiff
path: root/private/model
diff options
context:
space:
mode:
authorKevin J Hoerr <kjhoerr@protonmail.com>2017-07-08 11:11:53 -0400
committerKevin J Hoerr <kjhoerr@protonmail.com>2017-07-08 11:11:53 -0400
commit2d796d48df6f4371111bcbc776ea781e4f45c831 (patch)
tree8b70da2114d71d2835b2f58eb2d43083a3ff5a6f /private/model
parent3b75177580e536ce309d44759eb4d1f772c987ce (diff)
downloadaugust-offensive-2d796d48df6f4371111bcbc776ea781e4f45c831.tar.gz
august-offensive-2d796d48df6f4371111bcbc776ea781e4f45c831.tar.bz2
august-offensive-2d796d48df6f4371111bcbc776ea781e4f45c831.zip
Expand on query and result, begin sql design
Diffstat (limited to 'private/model')
-rw-r--r--private/model/Connection.php41
1 files changed, 0 insertions, 41 deletions
diff --git a/private/model/Connection.php b/private/model/Connection.php
deleted file mode 100644
index 42cba28..0000000
--- a/private/model/Connection.php
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace AugustOffensive\model;
-
-/**
- * Model connection class for connecting to database via PDO.
- */
-class Connection
-{
- /** @var \PDO $_conn PDO connection to database. */
- private $_conn;
- /**
- * Initiates connection to PostGreSQL database.
- *
- * @return Connection
- */
- public function __construct ()
- {
- // Establish connection to db
- include 'creds.php';
-
- try {
- $_conn = new \PDO(
- "pgsql: host=" . $cred->host .
- (($cred->port !== '') ? ";port=" . $cred->port : '') .
- ";dbname=" . $cred->dbName,
- $cred->login,
- $cred->password
- );
- // we destroy $cred as quickly as possible
- $cred = null;
- } catch (\PDOException $e) {
- // we destroy $cred as quickly as possible
- $cred = null;
- die(json_encode(array("Result-Type" => "Error", "Content" => array($e->getMessage()))));
- }
- return $this;
- }
-}