-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
32 lines (23 loc) · 923 Bytes
/
index.php
File metadata and controls
32 lines (23 loc) · 923 Bytes
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
<?php
declare(strict_types=1);
use PhpMicroframework\Application\Controller\DemoController;
use PhpMicroframework\Framework\Core;
use PhpMicroframework\Framework\Problem;
use PhpMicroframework\Framework\Router;
require dirname(__DIR__) . '/vendor/autoload.php';
// Set error reporting level for development.
error_reporting(E_ALL);
// This can be set in php.ini and removed here.
date_default_timezone_set('UTC');
// Enable error messages on 500 pages.
Problem::setDisplayErrorsEnabled(true);
// Register all PSR-4 namespaces where the framework should search for controllers.
// The framework will search in array order until the first controller match is found.
Router::$namespaces = [
'PhpMicroframework\\Application\\Controller',
];
// Set the demo controller and method as home page.
Router::$defaultController = DemoController::class;
Router::$defaultMethod = 'hello';
// Run the framework.
Core::run();