AspireCloud/public/index.php
Sarah Savage c39747f07b Improvements and upgrades
* Making the .env and .env.dist files part of the webapp container
to ensure that they are loaded by default.
* Upgrading Composer dependencies.
* Removing vlucas/dotenv because it's not needed anymore with us
loading env values directly into the container.
2024-10-10 07:43:50 -04:00

30 lines
910 B
PHP

<?php
declare(strict_types=1);
// Delegate static file requests back to the PHP built-in webserver
if (PHP_SAPI === 'cli-server' && $_SERVER['SCRIPT_FILENAME'] !== __FILE__) {
return false;
}
chdir(dirname(__DIR__ ));
require 'vendor/autoload.php';
/**
* Self-called anonymous function that creates its own scope and keeps the global namespace clean.
*/
(function () {
/** @var \Psr\Container\ContainerInterface $container */
$container = require 'config/container.php';
/** @var \Mezzio\Application $app */
$app = $container->get(\Mezzio\Application::class);
$factory = $container->get(\Mezzio\MiddlewareFactory::class);
// Execute programmatic/declarative middleware pipeline and routing
// configuration statements
(require 'config/pipeline.php')($app, $factory, $container);
(require 'config/routes.php')($app, $factory, $container);
$app->run();
})();