aboutsummaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorKevin J Hoerr <kjhoerr@protonmail.com>2017-06-21 23:03:15 -0400
committerKevin J Hoerr <kjhoerr@protonmail.com>2017-06-21 23:03:15 -0400
commit92465af465886f14f22bb60dd974a93baa9c5322 (patch)
tree2f9a660371cab99e842e4a93ad9818128e6e3390 /index.php
parent4406034152597a049de0706520a274f6e6271fe9 (diff)
downloadaugust-offensive-92465af465886f14f22bb60dd974a93baa9c5322.tar.gz
august-offensive-92465af465886f14f22bb60dd974a93baa9c5322.tar.bz2
august-offensive-92465af465886f14f22bb60dd974a93baa9c5322.zip
Add basic MVC structure with namespacing and PHPDOC (not tested)
Diffstat (limited to 'index.php')
-rw-r--r--index.php41
1 files changed, 41 insertions, 0 deletions
diff --git a/index.php b/index.php
new file mode 100644
index 0000000..3e770fe
--- /dev/null
+++ b/index.php
@@ -0,0 +1,41 @@
+<?php
+
+namespace AugustOffensive;
+
+include 'private/view/Result.php';
+include 'private/model/Connection.php';
+
+use AugustOffensive\view;
+use AugustOffensive\model;
+
+/**
+ * Constructive controller and initializer API for the service.
+ */
+class Api
+{
+ /** @var \Connection $connection the model database interface */
+ private $connection;
+
+ /** @var \Result $view the view interface that outputs result of the query */
+ private $view;
+
+ /**
+ * Initiates database connection and forwards environment to the view.
+ *
+ * @return Api
+ */
+ public function __construct ()
+ {
+ $connection = new model\Connection();
+ $view = new view\Result($connection);
+
+ // Provide hook for connecting through controller to justify query
+ $result = $view->collect();
+
+ // Leak the data
+ echo $result;
+ }
+}
+
+new Api();
+