-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
37 lines (29 loc) · 992 Bytes
/
functions.php
File metadata and controls
37 lines (29 loc) · 992 Bytes
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
<?php
declare(strict_types=1);
/**
* %theme_name% Theme Functions
*
* This file registers the theme with the Pollora framework using the
* ThemeRegistrar service directly.
*/
use Pollora\Theme\Domain\Contracts\ThemeRegistrarInterface;
// Ensure Pollora framework is loaded
if (! function_exists('app') || ! app()->bound(ThemeRegistrarInterface::class)) {
return;
}
// Register this theme as the active theme using the registrar service directly
try {
/** @var ThemeRegistrarInterface $themeRegistrar */
$themeRegistrar = app(ThemeRegistrarInterface::class);
// Register the theme with its path (auto-detected) and metadata
$themeRegistrar->register();
} catch (Exception $e) {
// TODO Make a Pollora Logger
$logger = app()->bound('log') ? app('log') : null;
if ($logger) {
$logger->error('Failed to register SolidarMonde theme', [
'error' => $e->getMessage(),
'trace' => $e->getTraceAsString(),
]);
}
}