blob: 03bce1be6f69e77507feda338fca324dcf58b5a5 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
<?php
declare(strict_types = On);
namespace AugustOffensive;
include 'private/model/Connection.php';
include 'private/view/Result.php';
include 'private/controller/Controller.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();
|