setPsr4('ForkBB\\', __DIR__ . '/'); if (file_exists(__DIR__ . '/config/main.php')) { $container = new Container(include __DIR__ . '/config/main.php'); } elseif (file_exists(__DIR__ . '/config/install.php')) { $container = new Container(include __DIR__ . '/config/install.php'); } else { throw new Exception('Application is not configured'); } define('PUN', 1); $container->DIR_CONFIG = __DIR__ . '/config'; $container->DIR_CACHE = __DIR__ . '/cache'; $container->DIR_VIEWS = __DIR__ . '/templates'; $container->DIR_LANG = __DIR__ . '/lang'; $container->START = $pun_start; $config = $container->config; $container->date_formats = [$config['o_date_format'], 'Y-m-d', 'Y-d-m', 'd-m-Y', 'm-d-Y', 'M j Y', 'jS M Y']; $container->time_formats = [$config['o_time_format'], 'H:i:s', 'H:i', 'g:i:s a', 'g:i a']; $page = null; $controllers = ['Routing', 'Primary']; while (! $page instanceof Page && $cur = array_pop($controllers)) { $page = $container->$cur; } if ($page instanceof Page) { //???? if ($page->getDataForOnline(true)) { $container->Online->handle($page); } $tpl = $container->View->setPage($page)->outputPage(); if (defined('PUN_DEBUG')) { $debug = $container->Debug->debug(); $debug = $container->View->setPage($debug)->outputPage(); $tpl = str_replace('', $debug, $tpl); } exit($tpl); }