forked from panique/tiny
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
37 lines (30 loc) · 1.32 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
<?php
/**
* A simple PHP MVC skeleton
*
* @package php-mvc
* @author Panique
* @link http://www.php-mvc.net
* @link https://github.com/panique/php-mvc/
* @license http://opensource.org/licenses/MIT MIT License
*/
// 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', __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/pdo-debug.php';
// load application class
require APP . '/core/application.php';
require APP . '/core/controller.php';
// start the application
$app = new Application();