-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
56 lines (45 loc) · 1.55 KB
/
Copy pathindex.php
File metadata and controls
56 lines (45 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/**
* Grafida — edit Joomla! articles on your desktop.
*
* @copyright Copyright (c) 2026 Nicholas K. Dionysopoulos
* @license GNU General Public License version 3, or later
*/
declare(strict_types=1);
use Boson\Application;
use Boson\ApplicationCreateInfo;
use Boson\Component\Http\Static\FilesystemStaticProvider;
use Boson\WebView\Api\Schemes\Event\SchemeRequestReceived;
use Boson\WebView\WebViewCreateInfo;
use Boson\Window\WindowCreateInfo;
use Boson\Window\WindowDecoration;
use Grafida\Application\ContainerFactory;
use Grafida\FrontController;
require __DIR__ . '/vendor/autoload.php';
$app = new Application(new ApplicationCreateInfo(
schemes: ['boson'],
debug: (bool) filter_var(getenv('BOSON_DEBUG'), \FILTER_VALIDATE_BOOLEAN, \FILTER_NULL_ON_FAILURE),
window: new WindowCreateInfo(
title: 'Grafida',
width: 1280,
height: 860,
decoration: WindowDecoration::DarkMode,
webview: new WebViewCreateInfo(
devTools: (bool) filter_var(getenv('BOSON_DEBUG'), \FILTER_VALIDATE_BOOLEAN, \FILTER_NULL_ON_FAILURE),
),
),
));
$static = new FilesystemStaticProvider([
__DIR__ . '/assets/private',
__DIR__ . '/assets/public',
]);
$container = ContainerFactory::create([
'static.provider' => $static,
'dialog' => $app->dialog,
]);
$controller = $container->get(FrontController::class);
$app->on(static function (SchemeRequestReceived $e) use ($controller): void {
$e->response = $controller($e->request);
});
$app->webview->url = 'boson://app/';
$app->run();