2015-08-30 12:34:43 -04:00
|
|
|
<?php
|
|
|
|
|
2023-05-12 23:34:43 -04:00
|
|
|
use DI\Container;
|
|
|
|
use Slim\Factory\AppFactory;
|
2015-08-30 12:34:43 -04:00
|
|
|
use Slim\Views\Twig;
|
2023-05-12 23:34:43 -04:00
|
|
|
use Slim\Views\TwigMiddleware;
|
2015-08-30 12:34:43 -04:00
|
|
|
|
2023-05-12 23:34:43 -04:00
|
|
|
require __DIR__ . '/../vendor/autoload.php';
|
2015-08-30 12:34:43 -04:00
|
|
|
|
|
|
|
// Let's get this session started
|
|
|
|
session_cache_limiter(false);
|
|
|
|
session_start();
|
|
|
|
|
|
|
|
// For now, display some errors
|
|
|
|
ini_set('display_errors', 'On');
|
|
|
|
|
2023-05-12 23:34:43 -04:00
|
|
|
// Create new container object
|
|
|
|
$container = new Container();
|
|
|
|
// Set container to create App with on AppFactory
|
|
|
|
AppFactory::setContainer($container);
|
|
|
|
$app = AppFactory::create();
|
2015-08-30 12:34:43 -04:00
|
|
|
|
2023-05-12 23:34:43 -04:00
|
|
|
// Create Twig
|
|
|
|
$twig = Twig::create(__DIR__ . '/../views', ['cache' => false]);
|
|
|
|
// Add Twig-View Middleware
|
|
|
|
$app->add(TwigMiddleware::create($app, $twig));
|
2015-08-30 12:34:43 -04:00
|
|
|
|
|
|
|
// Database configs
|
2023-05-12 23:34:43 -04:00
|
|
|
//require 'database.php';
|
2015-08-30 12:34:43 -04:00
|
|
|
// Routes configs
|
|
|
|
require 'routes.php';
|