芝麻web文件管理V1.00
编辑当前文件:/home/mgatv524/public_html/mctv/web/maint/index.php
. */ use Monolog\Logger; use Monolog\Processor\UidProcessor; use Psr\Container\ContainerInterface; use Slim\Views\TwigMiddleware; use Xibo\Factory\ContainerFactory; DEFINE('XIBO', true); define('PROJECT_ROOT', realpath(__DIR__ . '/../..')); error_reporting(1); ini_set('display_errors', 1); require PROJECT_ROOT . '/vendor/autoload.php'; if (!file_exists(PROJECT_ROOT . '/web/settings.php')) die('Not configured'); // Create the container for dependency injection. try { $container = ContainerFactory::create(); } catch (Exception $e) { die($e->getMessage()); } $container->set('logger', function (ContainerInterface $container) { $logger = new Logger('MAINT'); $uidProcessor = new UidProcessor(); // db $dbhandler = new \Xibo\Helper\DatabaseLogHandler(); $logger->pushProcessor($uidProcessor); $logger->pushHandler($dbhandler); return $logger; }); $app = \DI\Bridge\Slim\Bridge::create($container); $app->setBasePath($container->get('basePath')); $container->set('name', 'maint'); // Config $app->configService = $container->get('configService'); // Check for upgrade after we've loaded settings to make sure the main app gets any custom settings it needs. if (\Xibo\Helper\Environment::migrationPending()) { die('Upgrade pending'); } $twigMiddleware = TwigMiddleware::createFromContainer($app); $app->add(new \Xibo\Middleware\Log($app)); $app->add(new \Xibo\Middleware\State($app)); $app->add($twigMiddleware); $app->add(new \Xibo\Middleware\Storage($app)); $app->add(new \Xibo\Middleware\Xmr($app)); $app->addRoutingMiddleware(); $app->addErrorMiddleware(true, true, true); // Configure a user //$app->user = $container->get('userFactory')->getSystemUser(); /* // Configure the Slim error handler $app->error(function (\Exception $e) use ($app) { $app->container->get('\Xibo\Controller\Error')->handler($e); }); // Configure a not found handler $app->notFound(function () use ($app) { $app->container->get('\Xibo\Controller\Error')->notFound(); }); */ // All routes $app->get('/', ['\Xibo\Controller\Maintenance','run']); // Run app $app->run();