2017-12-06 23:43:53 +00:00
|
|
|
<?php
|
2024-07-28 23:34:18 +00:00
|
|
|
use Slim\Factory\AppFactory;
|
2017-12-06 23:43:53 +00:00
|
|
|
if (PHP_SAPI == 'cli-server') {
|
|
|
|
// To help the built-in PHP dev server, check if the request was actually for
|
|
|
|
// something which should probably be served as a static file
|
|
|
|
$url = parse_url($_SERVER['REQUEST_URI']);
|
|
|
|
$file = __DIR__ . $url['path'];
|
|
|
|
if (is_file($file)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
require __DIR__ . '/../vendor/autoload.php';
|
|
|
|
|
|
|
|
session_start();
|
|
|
|
|
|
|
|
// Instantiate the app
|
|
|
|
|
|
|
|
// Set up dependencies
|
|
|
|
require __DIR__ . '/../src/dependencies.php';
|
|
|
|
|
2024-07-29 01:57:34 +00:00
|
|
|
AppFactory::setContainer($container);
|
|
|
|
$app = AppFactory::create();
|
|
|
|
|
2017-12-06 23:43:53 +00:00
|
|
|
// Register middleware
|
|
|
|
require __DIR__ . '/../src/middleware.php';
|
|
|
|
|
2024-07-29 01:57:34 +00:00
|
|
|
// Require DB
|
|
|
|
require __DIR__.'/../db/db.php';
|
2017-12-06 23:43:53 +00:00
|
|
|
// Register routes
|
|
|
|
require __DIR__ . '/../src/routes.php';
|
|
|
|
|
|
|
|
|
|
|
|
// Run app
|
|
|
|
$app->run();
|