forked from panique/mini
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
39 lines (31 loc) · 1.41 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
<?php
/**
* MINI - an extremely simple naked PHP application
*
* @package mini
* @author Panique
* @link http://www.php-mini.com
* @link https://github.com/panique/mini/
* @license http://opensource.org/licenses/MIT MIT License
*/
// TODO get rid of this and work with namespaces + composer's autoloader
// set a constant that holds the project's folder path, like "/var/www/".
// DIRECTORY_SEPARATOR adds a slash to the end of the path
define('ROOT', dirname(__DIR__) . DIRECTORY_SEPARATOR);
// set a constant that holds the project's "application" folder, like "/var/www/application".
define('APP', ROOT . 'application' . DIRECTORY_SEPARATOR);
// This is the (totally optional) auto-loader for Composer-dependencies (to load tools into your project).
// If you have no idea what this means: Don't worry, you don't need it, simply leave it like it is.
if (file_exists(ROOT . 'vendor/autoload.php')) {
require ROOT . 'vendor/autoload.php';
}
// load application config (error reporting etc.)
require APP . 'config/config.php';
// FOR DEVELOPMENT: this loads PDO-debug, a simple function that shows the SQL query (when using PDO).
// If you want to load pdoDebug via Composer, then have a look here: https://github.com/panique/pdo-debug
require APP . 'libs/helper.php';
// load application class
require APP . 'core/application.php';
require APP . 'core/controller.php';
// start the application
$app = new Application();