From 2d796d48df6f4371111bcbc776ea781e4f45c831 Mon Sep 17 00:00:00 2001 From: Kevin J Hoerr Date: Sat, 8 Jul 2017 11:11:53 -0400 Subject: Expand on query and result, begin sql design --- index.php | 49 ++++++++++++++----------------------------------- 1 file changed, 14 insertions(+), 35 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index 1d59a8d..8c9ef11 100644 --- a/index.php +++ b/index.php @@ -4,42 +4,21 @@ declare(strict_types=1); namespace AugustOffensive; -include 'private/model/Connection.php'; -include 'private/view/Result.php'; -include 'private/controller/Controller.php'; +// y u no autoload +include 'private/Model/Connection.php'; +include 'private/Model/Query.php'; +include 'private/Model/Result.php'; +include 'private/View/Main.php'; +include 'private/Controller/Controller.php'; -use AugustOffensive\view; -use AugustOffensive\model; +use AugustOffensive\View; +use AugustOffensive\Model; -/** - * Constructive controller and initializer API for the service. - */ -class Api -{ - /** @var model\Connection $connection the model database interface */ - private $connection; +// initiate connection and build front-end +$connection = new Model\Connection(); +$view = new View\Main($connection); - /** @var view\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 () - { - $this->connection = new model\Connection(); - $this->view = new view\Result($this->connection); - - // Provide hook for connecting through controller to justify query - $result = $this->view->collect(); - - // Leak the data - echo $result; - return $this; - } -} - -new Api(); +// get results of query from front-end +$result = $view->generateResult(); +echo $result; -- cgit