refactor(index): simplify call to SeaCMS/App

(cherry picked from commit 767762d0922c41483a4bf1630516b6e5ca962b74)
This commit is contained in:
Jérémy Dufraisse 2023-02-23 11:54:22 +01:00
parent 64ae0237bc
commit e89968d9db
2 changed files with 8 additions and 23 deletions

9
composer.lock generated
View File

@ -264,7 +264,7 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://git.defis.info/SeaCMS/seacms-app", "url": "https://git.defis.info/SeaCMS/seacms-app",
"reference": "13832e4cc764530c6e86cc6976136a9899a9c507" "reference": "1a75dad626a585e25aa5c744ef8ae9fdeadaf68b"
}, },
"require": { "require": {
"composer": "^2.4", "composer": "^2.4",
@ -286,6 +286,11 @@
"pico-plugin-dir": "vendor/picocms/plugins/", "pico-plugin-dir": "vendor/picocms/plugins/",
"pico-theme-dir": "vendor/picocms/themes/" "pico-theme-dir": "vendor/picocms/themes/"
}, },
"autoload": {
"classmap": [
"App.php"
]
},
"archive": { "archive": {
"exclude": [ "exclude": [
"vendor", "vendor",
@ -307,7 +312,7 @@
"license": [ "license": [
"EUPL-1.2" "EUPL-1.2"
], ],
"time": "2023-02-22T18:48:16+00:00" "time": "2023-02-23T10:43:01+00:00"
}, },
{ {
"name": "seacms/seacms-theme", "name": "seacms/seacms-theme",

View File

@ -9,24 +9,4 @@ if (is_file(__DIR__ . '/vendor/autoload.php')) {
include_once(__DIR__ . '/vendor/autoload.php'); include_once(__DIR__ . '/vendor/autoload.php');
} }
\SeaCMS\App::run('content');
try {
// instance Pico
$pico = new Pico(
__DIR__, // root dir
'content/', // config dir
'vendor/picocms/plugins/', // plugins dir
'vendor/picocms/themes/' // themes dir
);
// run application
$output = $pico->run();
} catch (Throwable $th) {
$output = <<<HTML
<div style="color:red;">
Exception : {$th->__toString()}
</div>
HTML;
}
echo $output;