crispage/index.php
2024-09-06 22:19:41 -04:00

42 lines
1.0 KiB
PHP

<?php
/*
Crispage CMS
crispycat <cc@crispy.cat>
https://crispy.cat/software/crispage
Crispage is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
require_once __DIR__ . "/core/init.php";
// Load config (or the installer)
if (!file_exists(ROOT . "/config.php")) {
header("Location: //" . $_SERVER["SERVER_NAME"] . WROOT . "/package.php?mode=install");
die();
}
error_reporting(\Crispage\ApplicationConfig::get("crispage.dev.error_level", E_ALL));
// Load Crispage
require_once ROOT . "/core/app/Crispage.php";
$Crispage = new \Crispage();
// Use Crispage's exception handling
set_exception_handler([$Crispage, "handleException"]);
// Initialize
$Crispage->loadDatabase();
$Crispage->connectDatabase();
$Crispage->init();
// Load and run plugins
$Crispage->loadPlugins();
$Crispage->runPlugins();
// Process request
$Crispage->processRequest();
?>