-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
41 lines (34 loc) · 1.14 KB
/
index.php
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
<?php
require("vendor/autoload.php");
require("autoload.php"); // Probably there's a better way to do it, but it got virtually no attention
use Frameworkitto\Model;
use Frameworkitto\ControllerFactory;
/**
* If your app do access database you must to create a PDO instance then call static Model::setPDO()
*/
/**
$pdo = new PDO("mysql:dbname=DBNAMEHERE;host=localhost", "username", "password");
$pdo = new PDO("mysql:dbname=frameworkitto;host=localhost","frameworkitto",""); // <-- Sample
Model::setPDO($pdo); // Tell all the models to use this PDO instance.
*/
/**
* If your app will send email, you can must to set up the EmailSender:
* It uses PHPMailer.
*/
/**
EmailSender::setConfig([
"host" => "mail.mymailserver.com",
"auth" => true,
"username" => "[email protected]",
"password" => "myverysecurepassword",
"from_email" => "[email protected]",
"from_name" => "My incredible app!",
"secure" => "STARTTLS",
"port" => 465,
]);
*/
/**
* Instantiate the controler
*/
$controller = ControllerFactory::instantiateControllerByRoute(); // Choose which controller to instantiate
$controller->execute(); // Do the magic